1

I have a issue with limiting search results using PnP Modern Search.

In addition to pulling all *.docx documents from the document library, I would like to skip those that have the name "Attachments" in the path.

Example:

  1. https://sp.online/sites/DEV/Documents/Test1/Attachments
  2. https://sp.online/sites/DEV/Documents/Test2/Attachments
  3. https://sp.online/sites/DEV/Documents/Test3/Attachments
  4. https://sp.online/sites/DEV/Documents/Test4/Attachments

I would like to find documents under Test* folders but not under Attachments. So far I have tried the following KQL query but does not work:

 {searchTerms} path:https://sp.online/sites/DEV/Documents -path:https://sp.online/sites/DEV/Documents/*/Attachments/* fileextension:docx

Thank you!

0

1 Answer 1

0

The Path managed property is configured as Complete Matching.

Create new managed property without Complete Matching and recrawl Documents list/library See answer here

When you are creating new managed property "NewPath" look at default managed property "Path" and map all crawled properties like in "Path" managed property. see steps

Your new query:

 {searchTerms} path:https://sp.online/sites/DEV/Documents -NewPath:/Attachments fileextension:docx

NewPath = new managed property same like Path but only without Complete Matching

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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