3

I'm hoping some more experienced people can help me with this, i might just be missing something here.

Issue: A content type has a choice field/column in which multiple items can be selected, the end user wants to see only those items that have more then 1 item in the choice field selected. (and see them as a search result).

Currently the choice field is mapped to a refinablestring (RefinableString98) so that the list can be filtered accordingly.

Unsuccesfull attempts at solving this:

attempt1

If I look at the result of the refinable string in the Sharepoint Search Query Tool, when multiple values are selected as semicolon is used, so i thought a simple search query text of (put them all together here, but tried them seperately)

RefinableString98:; OR RefinableString98:";" OR RefinableString98:"*;" OR RefinableString98:"*;*" OR RefinableString98=; OR RefinableString98=";" OR RefinableString98="*;" OR RefinableString98="*;*"

would return me what i wanted, but no luck. Using actual values of the choice list followed by a semicolon would also return the results that had only that single item selected. The search seemingly ignoring the semicolon.

I tried some basic googling to see if i could somehow get sharepoint to do the count for me, but that didn't yield any results for this scenario.

attempt2

Knowing that there are refinableints, and hoping for some weird logic to be happening under the hood. (and trying couldnt hurt) So i mapped my column to a RefinableInt and tagged my sitecollection for reindexing, however an hour after doing that i still cannot see any items where a value has been set to the refinable int, so thats a no go either.

possible but in my opinion not elegant/good solution

There currently are 10 choices in the column, so i could attempt to do a permutation of all options involving 2 of the choices (using some linebreaks for readability):

{content type refiner} AND
(
(
RefinableString:"Option1" AND RefinableString:"Option2"
)
OR
(
RefinableString:"Option1" AND RefinableString:"Option3"
)
...
OR
...
(
RefinableString:"Option2" AND RefinableString:"Option3"
)
...

But everytime the choices get increased you are setting yourself up for a increasing ammount of work.

  • For now used the non elegant solution, and told the people that manage that list that this kind of solution only works for small lists that aren't at risk of changing frequently. I will keep checking back periodically in case someone found the holy grail. – MHDR Aug 28 '15 at 8:35
1

Regarding Semicolon will be seen as a white-space by KQL and FQL query languages.

From this part of your question

Using actual values of the choice list followed by a semicolon would also return the results that had only that single item selected. The search seemingly ignoring the semicolon.

I am wondering if you might have encountered this issue in SharePoint Incomplete search results for choice type columns with multiple values

You search for list-items or documents by using a keyword query which represents a choice value that is stored in a choice type column with multiple choices selected and you don't get back the expected search results or even no results at all.

The source of the problem is that SharePoint stores the multi choice value as a single string value.

Microsoft's solution to the problem is the following These are the solution steps for a site column with e.g. the name MyChoiceSiteColumn:

  1. Navigate to your Search Service Application administration site and click on Search Schema.

  2. Search for the managed property by entering MyChoiceSiteColumn and click on the retrieved MyChoiceSiteColumnOWSCHCM property to modify the configuration:

    1. You have to enable the options Searchable and Allow multiple values
  3. Finally save the new managed property with its configuration by clicking on OK

Hope this might help.

  • - Didn't know that KQL and FQL see a semicolon as a white-space, so that explains the failure in using that approach (no way to escape that?) - Found the OWSCHCM field, cannot change the searchable and allow multiple values options. (tried sitecollection and search site, multiple values is activated on the RefinableString though) -> refining works using RefinableString; Its the filtering of the initial search result to show only those that have more then 1 item selected thats causing me issues. – MHDR Aug 27 '15 at 10:12

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.