SOLVED

problem with pnp search always dispaying the same results

%3CLINGO-SUB%20id%3D%22lingo-sub-3286725%22%20slang%3D%22en-US%22%3Eproblem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3286725%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20am%20using%20PnP%20Modern%20Search%20web%20parts%20on%20sharepoint%20online%20and%20each%20time%20i%20try%20to%20search%20it%20seems%20that%20i%20got%20always%20the%20same%20results%20(and%20the%20same%20result%20count)%20whatever%20my%20search%20words%20is.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20did%20only%20one%20custom%20thing%20%3Aon%20the%20text%20request%20of%20the%20pnp%20search%20result%20webpart%20here%20is%20what%20i%20put%20%3A%7BsearchTerms%7D%3CBR%20%2F%3Efileextension%3Adocx%20OR%20fileextension%3Adoc%20OR%20fileextension%3Apdf%20OR%20fileextension%3Axls%20OR%20fileextension%3Axlsx%20OR%20fileextension%3Apptx%3CBR%20%2F%3EOR%20fileextension%3Appt%3CBR%20%2F%3EPath%3A%3CA%20href%3D%22https%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSiteX%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSiteX%3C%2FA%3E%20OR%3CBR%20%2F%3EPath%3A%3CA%20href%3D%22https%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSiteY%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSiteY%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20any%20idea%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehere%20are%20some%20image%20with%202%20different%20searchs%20with%20the%20same%20results%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture_resultmother.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364522i598C8460F4C1CEF1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture_resultmother.PNG%22%20alt%3D%22Capture_resultmother.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture_resulttest.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364523i22BB87CDA9B91ADB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture_resulttest.PNG%22%20alt%3D%22Capture_resulttest.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3287451%22%20slang%3D%22en-US%22%3ERe%3A%20problem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3287451%22%20slang%3D%22en-US%22%3EActually%20i%20saw%20i%20didn't%20connect%20the%20search%20result%20to%20the%20search%20box%20that's%20why%20it%20didn't%20work.%20%3B)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3287450%22%20slang%3D%22en-US%22%3ERe%3A%20problem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3287450%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1350096%22%20target%3D%22_blank%22%3E%40captainclito%3C%2FA%3E%26nbsp%3BHere%20is%20the%20solution.%20As%20i%20used%20the%20microsoft%20search%20box%20i%20had%20to%20connect%20the%20search%20result%20web%20part%20to%20it%3B%20i%20didn't%20do%20it%20that's%20why%20it%20didn't%20work.%20%3CA%20href%3D%22https%3A%2F%2Fmicrosoft-search.github.io%2Fpnp-modern-search%2Fusage%2Fsearch-results%2Fconnections%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmicrosoft-search.github.io%2Fpnp-modern-search%2Fusage%2Fsearch-results%2Fconnections%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3287327%22%20slang%3D%22en-US%22%3ERe%3A%20problem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3287327%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1350096%22%20target%3D%22_blank%22%3E%40captainclito%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehave%20you%20tested%20it%20on%20a%20page%20with%20the%20PnP%20Search%20Box%3F%20Same%20counts%20of%20results%3F%20With%20Microsoft%20Search%20Data%20Source%20you%20have%20APi%20entity%20types%20to%20use%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fmicrosoft-search.github.io%2Fpnp-modern-search%2Fusage%2Fsearch-results%2Fdata-sources%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmicrosoft-search.github.io%2Fpnp-modern-search%2Fusage%2Fsearch-results%2Fdata-sources%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%20Dave%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3287048%22%20slang%3D%22en-US%22%3ERe%3A%20problem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3287048%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1207%22%20target%3D%22_blank%22%3E%40David%20Mehr%3C%2FA%3EHello%20thanks%20for%20the%20answer.%20Actually%20the%20request%20can%20be%20read%20like%20this%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%7BsearchTerms%7D%0A(fileextension%3Adocx%20OR%20fileextension%3Adoc%20OR%20fileextension%3Apdf%20OR%20fileextension%3Axls%20OR%20fileextension%3Axlsx%20OR%20fileextension%3Apptx%0AOR%20fileextension%3Appt)%20AND%0A(Path%3Ahttps%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSITEX%20OR%0APath%3Ahttps%3A%2F%2FTENANT.sharepoint.com%2Fsites%2FSITEY)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EFurthermore%20i%20use%20Microsoft%20Search%20box%20because%20i%20modify%20search%20parameter%20so%20that%20result%20be%20put%20in%20a%20my%20custom%20page%20and%20i%20used%20in%20the%20pnp%20search%20result%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture_searchparameter.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364622i1D1197945573817B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture_searchparameter.PNG%22%20alt%3D%22Capture_searchparameter.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture_pnpresultbox.PNG%22%20style%3D%22width%3A%20345px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364623i58AC1594483ED787%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture_pnpresultbox.PNG%22%20alt%3D%22Capture_pnpresultbox.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3286902%22%20slang%3D%22en-US%22%3ERe%3A%20problem%20with%20pnp%20search%20always%20dispaying%20the%20same%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3286902%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1350096%22%20target%3D%22_blank%22%3E%40captainclito%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eis%20that%20an%20%E2%80%9Eand%E2%80%9C%20or%20%E2%80%9Eor%E2%80%9C%20before%20the%20path%3F%20And%20i%20have%20see%20that%20you%20put%20in%20the%20query%20in%20the%20Microsoft%20Search%20box%2C%20not%20in%20an%20PnP%20Search%20Box%2C%20try%20to%20configure%20a%20PnP%20search%20box%20and%20check%20your%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%20Dave%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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 resultsCapture_resultmother.PNGCapture_resulttest.PNG

5 Replies

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

@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 resultCapture_searchparameter.PNGCapture_pnpresultbox.PNG

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

best response confirmed by captainclito (Occasional Contributor)
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/

Actually i saw i didn't connect the search result to the search box that's why it didn't work. ;)