none
Search Result webpart query path RRS feed

  • Question

  • Hi, 

    I'm trying to build a search query in my search result webpart. 

    I have a lot of site collection beginning with "https://sitecol-x.com" (x is a number between 0 and 999) 

    I'd like to make my query on all those site collection where the url begin with "https://sitecol" so it should be like : 

    {searchboxquery} Path:https://sitecol*

    with the asterisk * but it doesn't work. 

    The workaround is to add multiple Path terms 

    {searchboxquery}

    Path:https://sitecol-001.com  Path:https://sitecol-002.com Path:https://sitecol-003.com ... Path:https://sitecol-999.com


    not quite good :/

    Do you have any solution ?

    Thanks



    Friday, November 8, 2019 2:21 PM

All replies

  • hi nguyen,

    using * operator in Path managed property is not allowed so you have to add separate paths.

    you can create a new content source in central admin and give the crawl url as https://sitecol*(make sure to select sharepoint content) then run a full crawl and check whether the other sites are being crawled or not(inside crawl logs). once that is done you can simply create a result source and configure that result source in your search query web part.


    K Mohit


    • Edited by KumarMohiT Friday, November 8, 2019 3:31 PM
    • Marked as answer by Nguyen Kevin Wednesday, November 13, 2019 11:30 AM
    • Unmarked as answer by Nguyen Kevin Wednesday, November 13, 2019 3:20 PM
    Friday, November 8, 2019 3:30 PM
  • Hi Nguyen, 

    It should be supporeted to use the wildcard operator (*) to enable prefix matching.

    Where do you add the query? Does the query Path:https://sitecol* not work? Try to search with Path:https://sitecol* directly and compare the results. 

    Reference:

    https://docs.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, November 11, 2019 9:48 AM
    Moderator
  • Hi, thanks for your response. 

    I'm changing the query in the Search result webpart. 

    I tried to search Path:https://sitecol*, it doesn't work. 

    I tried to create a new content source in central admin, with "https://sitecol*" and it ended with an error, wrong format.



    • Edited by Nguyen Kevin Wednesday, November 13, 2019 3:27 PM
    Wednesday, November 13, 2019 10:38 AM
  • Hi Nguyen, 

    Try the following:

    {searchboxquery} Path:https://sitecol-*

    If the issue still exists, you need to add multiple Path terms 

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, December 4, 2019 10:21 AM
    Moderator