2

I'm trying to filter values in a result-source in SharePoint Online. I want for example all values starting with an "A".

Initial query:

Property:A* - Results "Adam and Mary", but also the unwanted "Mary and Adam"

I re-adjusted the values with underscores, but no solution: Property:A* Results still "Adam_and_Mary", but still also the unwanted "Mary_and_Adam"

I re-adjusted the values with a leading dash, but no solution: Property:-A* Results still "-Adam and Mary", but still also the unwanted "-Mary and Adam"

I don't understand the logic in this. Is there any way to solve this ? With another query or re-adjusting the values ? Property=A* is giving no results at all.

1
  • Do you use the search API or the OOTB search box/Web parts? – Evariste Jun 4 '17 at 16:35
2

Here's why you do get these results:

  1. Using a space, an underscore or a dash does not change how the text is word-broken and how the property value is stored in the index. (only storing the value as AdamAndMary may work as you expect)
  2. Using Property:A* means "I want results where property contains a word starting with A". This does not force the entire value of property to start with A.
  3. Note: using Property:"A*" would be the same. The use of double-quotes would simply allow to add spaces in the filter value, like in Property:"Team d*" that would return results whose Property contains "Team discussion" or "Team deliberation".

As for a solution (not sure one better than storing "AdamAndMary" exists, but): do you use an API or is it something related to the use/configuration of the OOTB search box/Web parts?

3
  • Thanx Evariste, I use OOTB. Maybe another sigg, like # as a leading character would work ? – oysterhoys Jun 4 '17 at 16:53
  • We can't find anything interesting in the entire KQL documentation: dev.office.com/sharepoint/docs/general-development/… :( – Evariste Jun 4 '17 at 17:35
  • If you could insert a leading "something", something being a letter or a word (not a dash), maybe you could find a way. Let's say you add a leading "V" like this: "V: Adam and Mary", a search for Property:"V: A*" should work? – Evariste Jun 4 '17 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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