0

I have created a Content Search Query Web part which go through a document library and shows the result based on the column (metadata).

The old metadata was LGBTI and it was working fine, however since I have changed the LGBTI to LGBTIQA+ the search result is showing nothing.

So basically I have changed LGBTI to LGBTIQA+ and it stop working.

Below is my search query:

path:{Site.URL}/Documents  (IsDocument:"True" OR contentclass:"STS_ListItem") (PrgBusinessUnit={User.BusinessCategory} OR PrgBusinessUnit="All Business Units") ((PrgTopic="LGBTI") OR (PrgTopic="LGBTIQA+")) 

enter image description here

2
  • Is PrgTopic a managed metadata column, a choice field or just text? Jul 25 '19 at 15:43
  • thanks for your reply, please see the screenshot
    – Harris
    Jul 26 '19 at 3:07
0

I am guessing: the display value of the 'LGBTI' term was changed to 'LGBTIQA+' and this messed up the query? In that case you are lucky and the update pretty simple: Update the query to use the guid of the term rather than the display value : ((PrgTopic="LGBTI") would look like ((PrgTopic:"the guid from the term "), pls note the change from = to :

I know that it makes query hard to read but it works and makes it resilient to changes

3
  • Hi Kasper, thanks for your message, i am not too sure what you mean when you say use the guide of the term rather than display value, can you please provide me more information ?
    – Harris
    Jul 30 '19 at 2:28
  • This is my current query: path:{Site.URL}/Documents (IsDocument:"True" OR contentclass:"STS_ListItem") (PrgBusinessUnit={User.BusinessCategory} OR PrgBusinessUnit="All Business Units") ((PrgTopic="LGBTI") OR (PrgTopic="LGBTIQA+"))
    – Harris
    Jul 30 '19 at 2:29
  • What does the mapping for PrgTopic look like? A great tool when working with Sharepoint search is the SP Search Query tool on github as it show the field values for each managed property Jul 30 '19 at 6:22

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.