none
Search box web part to only show results in other search results web parts

    Question

  • Hello,

    I have a site that has a search box web part and multiple search results web parts. Each search results web part has a query to show results from the required lists across our SharePoint tenant and our search box web part is connected to all the search results web parts by selecting them in the settings under 'send queries to other web parts on this page'.

    My question is, when I search for a specific reference using the search box web part it will then highlight the words in the other web parts but ideally I would like the other web parts to filter out anything that is not the searched on reference. So I we searched for 'despatch label' it would only show any documents with 'despatch label' in the name instead of keeping all the documents visible and highlighting the phrase despatch label.

    Example

    mardi 8 mai 2018 15:22

Réponses

  • Hi James,

    Thanks for your reply.

    Since title is extracted using getHighlightedProperty method, it should be listed in "Hit-highlighted properties (JSON)" in properties of SearchReslts Web part, below "Use a single template to display items" option where you configured it to use "Item Default" web part.

    var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "filename");


    Best regards,
    Ethan Liu


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

    • Marqué comme réponse James_Riach mercredi 23 mai 2018 15:43
    mercredi 23 mai 2018 09:42

Toutes les réponses

  • Hi James,

    Based on your description, I understand you want to ignore the documents when it contains the search text as content. If my understanding is not correct, please feel free to let me know.

    If you have connected your search box webpart to all the results webpart it should display only documents that contain your search text. To achieve your requirement, you need to filter your results by configuring the search results webpart.


    Best regards,
    Ethan Liu


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

    jeudi 10 mai 2018 07:58
  • Hello Ethan,

    Thank you for your response and yes you are correct. I would like to filter out all other results and only show what I have searched for in the Search Box web part.

    How do I go about adding this type of filter as I cannot see any options for this in the Search Box settings?

    Example

    Thanks,

    James

    jeudi 10 mai 2018 09:39
  • Hi James,

    Thanks for your reply.

    Since title is extracted using getHighlightedProperty method, it should be listed in "Hit-highlighted properties (JSON)" in properties of SearchReslts Web part, below "Use a single template to display items" option where you configured it to use "Item Default" web part.

    var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "filename");


    Best regards,
    Ethan Liu


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

    • Marqué comme réponse James_Riach mercredi 23 mai 2018 15:43
    mercredi 23 mai 2018 09:42