Multiple Search box to display specific set of content

  • anant
    Participant
    5 years ago #11517

    Hi,
    I am currently evaluating your WPSolr plugin and my requirement is that I want to use a search feature to display the indexed results of “blog posts” in the blog page and “courses” in another page. If I understand correctly when I configure WPSolr and contents (Pages, blog posts, courses, etc.) and use a search box anywhere in the website, it will display the results from all different items and not specific for Blog-posts, pages, courses, etc. Is there any way to allow a search box to only display content from blog posts on one page and only from pages (or courses/Lessons) on another?
    If so, please provide the step by step process to implement this.

    wpsolr
    Keymaster
    5 years ago #11662

    Hi,

    On your current search page, click on your “type” facet, and notice the filter parameter added to the url (for posts, pages, …).

    Now, on your search boxes forms, add a hidden parameter with the same field name and field value (in the html code, or with a bit of js). The hidden parameter will be added to the url and your search filtered by type.

    anant
    Participant
    5 years ago #11673

    @wpsolr: Thanks for getting back with a solution. Please share a screenshot/screen video/gif, so it is easier to follow the instruction.

    wpsolr
    Keymaster
    5 years ago #11674

    The support provide assistance on implemented features.

    For this feature, I suggest either:
    – Ask for a new feature in https://www.wpsolr.com/forums/forum/technical-configuration-issues/new-features-requests/
    – Ask for a custom work as described in https://www.wpsolr.com/forums/topic/do-you-provide-custom-work/

    anant
    Participant
    5 years ago #11675

    Also, this workaround is good for the search results but the WPSolr widget that has been used on the page still displays the values (such as Authors, Tags etc.) of all the results found in the Solr index. For example, when I see the WPSolr filter options on the blog page, I can see the author who wrote a lesson/course. Is there any ways to only display the values that belong to say posts, pages, course, etc.?

    wpsolr
    Keymaster
    5 years ago #11676

    If you add a filter for the search, it will also filter the facets.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.