Forum Discussion
problem with pnp search always dispaying the same results
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
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/
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
- captainclitoCopper Contributor
DaveMehr365Hello 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
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
- captainclitoCopper Contributor
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/