Apr 15 2022 06:57 AM
Hello,
I am using PnP Modern Search web parts on sharepoint online and each time i try to search it seems that i got always the same results (and the same result count) whatever my search words is.
i did only one custom thing :on the text request of the pnp search result webpart here is what i put :{searchTerms}
fileextension:docx OR fileextension:doc OR fileextension:pdf OR fileextension:xls OR fileextension:xlsx OR fileextension:pptx
OR fileextension:ppt
Path:https://TENANT.sharepoint.com/sites/SiteX OR
Path:https://TENANT.sharepoint.com/sites/SiteY.
Do you have any idea?
here are some image with 2 different searchs with the same results
Apr 15 2022 10:24 AM
Hello @captainclito
is that an „and“ or „or“ before the path? And i have see that you put in the query in the Microsoft Search box, not in an PnP Search Box, try to configure a PnP search box and check your results.
Regards, Dave
Apr 15 2022 12:11 PM
@David MehrHello thanks for the answer. Actually the request can be read like this
{searchTerms}
(fileextension:docx OR fileextension:doc OR fileextension:pdf OR fileextension:xls OR fileextension:xlsx OR fileextension:pptx
OR fileextension:ppt) AND
(Path:https://TENANT.sharepoint.com/sites/SITEX OR
Path:https://TENANT.sharepoint.com/sites/SITEY)
Furthermore i use Microsoft Search box because i modify search parameter so that result be put in a my custom page and i used in the pnp search result
Apr 15 2022 09:41 PM
Hello @captainclito
have you tested it on a page with the PnP Search Box? Same counts of results? With Microsoft Search Data Source you have APi entity types to use: https://microsoft-search.github.io/pnp-modern-search/usage/search-results/data-sources/
Regards, Dave
Apr 16 2022 04:41 AM
Solution@captainclito Here is the solution. As i used the microsoft search box i had to connect the search result web part to it; i didn't do it that's why it didn't work. https://microsoft-search.github.io/pnp-modern-search/usage/search-results/connections/
Apr 16 2022 04:43 AM