Question

I am building a search based A to Z (as it needs to run across site collections) on SharePoint 2013 and need to be able to find all pages where their 'AZText' managed property value starts with a given letter. I anticipated that I would need to use the following syntax:

AZText:A*

However this is returning all instances where any word in that field begins with "A", not just the first word. So it returns "Apples and Oranges" but also returns "Happily Ever After".

Does anyone know if it is possible to restrict this search to the whole value of the field so that "starts with" means the whole text and not each word within that text?

Was it helpful?

Solution

This is not doable with KQL or FQL. You would have to do some post-processing to accomplish this. FQL has an operator called starts-with, but cannot be used with wildcards, only terms or phrases.

If you could have another property on the list with AZText which copies the first letter of the value of AZText field, then that would work. Or if you do this in a content enrichment web service. Then this property could be used to search/group results per the first letter.

OTHER TIPS

MaxCharactersInPropertyStoreIndex=1 on a new managed property might do the trick, so it is limited to only storing a single character in the index (this should theoretically be available in PowerShell (but not in GUI).

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top