Hot answers tagged keywordquery
5
I found a blog where someone referenced the fact that you need to set the RankingModelId on the KeywordQuery. This works for the sample code you see above, as well as the custom extended CoreSearchResults web part I've built.
Here is the sample code:
using (SPSite spSite = new SPSite("http://localhost"))
{
SearchQueryAndSiteSettingsServiceProxy ...
4
If you have a high ratio of queries compared to deletes, then you might want to add an event receiver which calls CrawlRuleCollection.RemoveFromResults upon deletion of an item
2
This worked for me.
As Amit suggested, create a new managed property (CreatedDate) of type Date and Time.
Map it to these Crawled Properties
Basic:15(Date and Time)
ows_Start_x0020_Date(Date and Time)
ows_StartDate(Date and Time)
Office:12(Date and Time)
creationdate(Date and Time)
And select Include values from a single crawled property based on the ...
1
It may well be a bug, but for fellow travellers, I found this in TechNet:
http://technet.microsoft.com/en-us/library/jj683123.aspx
Dealing with spaces in values
Search queries use the space character to tokenize query values
issued by users. When a query variable is expanded to a value that
contains a space, the complete value is enclosed in ...
1
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 ...
1
I think you should go for CAML query or out-of-box filters instead of search to find items in specific lists.
If you want to use search anyhow, You can create a scope for each list and create managed property for each column to search for. Then, you can see below how to form keyword query with the properties and scopes :
...
Only top voted, non community-wiki answers of a minimum length are eligible