Tag Info

Hot answers tagged

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


3

Your filters should be: var refinementFilters = new string[] { "doc, docx" }; for (var i = 0; i < refinementFilters.Length; i++) { keywordQuery.RefinementFilters.Add("FileType:" + refinementFilters[i]); } where you add the property you want to filter on as part of the filter, not just the value. A good exercise is to use fiddler or similar when you ...


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 ...


2

you can create a scope in the Search Service Administration based on your content type or add it as a clause to the query i.e. foo AND ContentType:"My Content Type Name"


2

Without development you can try add a static query to the content search result webpart: tags:"Keyword X" or tags:"Keyword Y" or tags:"Keyword Z" - tags should be the managed property for the Enterprise Keyword column. With development you have to use the KeywordQueryClass, see: http://msdn.microsoft.com/en-us/library/ms544561%28office.12%29.aspx ...


2

You will need to create a custom Managed Property in your Search Service Application that maps to the crawled property ows_ContentType. Refer here and here for some help with that. (You can ignore the more advanced instructions on how to then create a refinement filter based on that, unless you want a refinement filter...) Be sure to run a full crawl ...


2

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 ...


2

Phonetic search is only for people searching. This is still the case in 2013. Its more specifically called "Phonetic People Matching".


1

Try casting the QueryCondition items from QueryConditions (which really is ends up being an IEnumerable<QueryCondition>) to KeywordCondition objects. From what I can tell, the collection is just a bunch of objects that report as the superclass, and you need to cast them to the specific class to actually access the properties that make them unique. I ...


1

Ok I have spent some time with this and it's a reasonably complex area but. I have discovered (DOH!) that I need to be using the Managed Property name in the KQL Search. So when the crawler crawls and finds a document property, column, etc. It creates a crawled property it also creates a mapped Managed Property. So when building your KQL you need to know ...


1

To exclude the Folders try adding "Size>0" to your query and see if that helps.


1

In your example you search for * in the fulltextindex in the rest api, and apply refinement filter for a date range on birthday field. Did the rest api return any refinement results for birthday? I assume you have already verified that your search schema is correct, birthday is queriable and refineable. In your c# example you don't perform the same query as ...


1

This is what I ended up doing: var file = Web.GetFile(fileId); var tags = new TaxonomyFieldValueCollection(file.Item.Properties["TaxKeyword"].ToString()); var query = new SPSiteDataQuery(); // build the query var sbQuery = new StringBuilder(); sbQuery.Append("<Where><In><FieldRef Name='TaxKeyword' /><Values>"); foreach (var tag in ...


1

You have to set CustomRefinementIntervals property on KeywordQuery


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