Why does scoped search bring multiple categories and sections results?

Return to top
Have more questions? Submit a request

11 Comments

  • Tara Papworth

    I've added this into the category, section and search results pages on our sandbox yet the search results are still bringing back results from all sections?

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Tara,

    If you add this code and refresh your browser or test from an Incognito window do you still get the same results? If so, any chance you could provide a screenshot of where you've entered this code so we can take a look?

    Thanks!

    0
  • Tara Papworth

    Hi Brett - I refreshed and it seems to work at category level but not at section level - is this correct? 

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Tara,

    If you added the code to you section page as well it should work there. Did you add it to both I assume? Can you provide a screenshot of the section page code?

    0
  • Tara Papworth

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Tara,

    Unless I'm misunderstanding you, wouldn't you want to use:

    {{search scoped=settings.scoped_kb_search submit=true}}

    to only show articles within that section?

    0
  • Tara Papworth

    Hi Brett - yes, and that's what I've used (line 5 in the image). Is there somewhere else I need to change it too?

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Tara,

    In the screenshot it looks like you're using

    {{search scoped=settings.scoped_kb_search submit=false}}

    Can you switch that value to true and see if that helps?

    0
  • Tara Papworth

    Thanks Brett - I swore I looked at your response and my screenshot multiple times to see if they matched!

    I have tried it with true as well, but it still does not work.

    It was set as false as per the resolution steps in this article - as you can see the advice states to add that code to both category and section pages.

    Which is correct? (although, either way it's still not working)

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Tara,

    I've created a ticket on your behalf with our Customer Care team so they can look into this with you. They should be able to dig into this further with you and come up with a solution.

    Cheers!

    0
  • William Grote

    I opened a ticket with Zendesk since after the initial scoped search of a category if you changed the search even by a letter the results go back to being global and was just told, "Yes, that's undesirable but it's not a bug"

     

    Then my developer spent a few minutes looking at the code and discovered that changing the parameters of the code to add scoped search via the settings options it does not update the code on any subsequent pages that would need it to also be true, for example, the SEARCH RESULTS page, you need to do it in both places, then it works 

     

    The problem is that this search is that working on two different pages with two different configurations. I don't know why, but when you change the setting of the searching in the options menu, the template only sets to true the scoped searching on the main page, but not the scoped searching of the other pages (for example the searching results page). Weird.
    0

Please sign in to leave a comment.

Powered by Zendesk