SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using FullTextSQLQuery or Search Web Service in my custom search solution till today. Wanted to explore KeywordQuery but usage of 'LastModifiedTime' in query doesn't return search results.

code snippet:

SPServiceContext context = SPServiceContext.GetContext(SPServiceApplicationProxyGroup.Default,

SearchServiceApplicationProxy ssap = context.GetDefaultProxy(typeof(SearchServiceApplicationProxy))
                    as SearchServiceApplicationProxy;
using (KeywordQuery query = new KeywordQuery(ssap))
query.QueryText = "IsDocument:1 Filename:\"Test*\" Path:\"http://sp2010vm/Shared Documents/*\" (LastModifiedTime > '2011/04/25 05:00:00 PM' AND LastModifiedTime <= '2011/04/26 06:00:00 PM')";

Removing LastModifiedTime check works perfectly. How to include LastModifiedTime criteria? Also,is there a way to simulate Filename LIKE 'Test%' behavior using KeywordQuery? Neither Filename:"Test%" nor Filename:"Test*" works this way.


share|improve this question
Any help on this? Does KeywordQuery support Filename:"Test%" or Filename:"Test*"? – Praveen Apr 9 '12 at 6:28

Try changing query to:

query.QueryText = "IsDocument:1 Filename:\"Test*\" Path:\"http://sp2010vm/Shared Documents/*\" (LastModifiedTime:\"2011-04-25..2011-04-26\")"; 

You cannot filter on time in SharePoint keyword queries. It is ignored (per design i guess)

For completeness: You can also choose to use the "internal" property write: instead of LastModifiedTime

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.