Hi @john john Pter,
Hope everything is going well.
First of all, it is true that in SharePoint we use GUIDs to differentiate each term, and terms in different term sets will have different GUIDs even if they have the same name. But the impact of this on PnP searches depends on how you use managed properties to search independent of the organization of the term.
For example, HR and Commercial both contain the Other
term, and we map the DocumentType
column to the managed property RefinableString100.
- If you use
RefinableString100:"Other"
in your PnP Search KQL statement, then all items that use the term name Other are returned. This is because the RefinableString100 managed property only records the names of the terms and not their GUIDs. - If you only want to get items that use Other terms in a specific term set, then you will need to use the ows_taxId_DocumentType property for your query. This property holds the GUID of the term. For example, to get only items that use the
Other
term in the HR term set you need to use this KQL statement: ows_taxId_DocumentType:"0c5f1a59-2334-4b23-XXX-abc1234ef567"
(This is followed by the GUID for theOther
term in the HR term set.)
Feel free to contact me if you have any concerns.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. It will be beneficial to more community members reading here. Your contribution will be highly appreciated.