Can I define multiple searches ?

328 views January 29, 2017 January 29, 2017 admin 0

MacBook

What do “multiple searches” mean ?

Multiple searches mean that you want to adjust your search results according to certain conditions.

What are those conditions ?

It can be anything related to the current page being displayed in your WordPress site. And it can be as complicated as necessary, to match your complex requirements.

Here are a few examples to clear the discussion:

  • A uri regular expression
    Example: url “/search-my-last-10-articles” should return only the last 10 posts.
  • A url parameter value
    Example: urls “/s=&post_type=product” should return only products.
  • The presence, or absence, of a plugin
    Example: if WPML plugin is present, return only results from the current language.
  • The current user role
    Example: if the current user is logged and has the role “manager”, it can see all results. Else, only blog posts.

 

How can I define multiple searches then ?

You can configure only one search in WPSOLR.

But WPSOLR comes with many WordPress Hooks (actions and filters). And with the hooks, you can do pretty much anything you want:

  • Add or remove Solr filters
  • Add or remove Solr sorts
  • Change default Solr parameters (boosts, highlighting size, …)

WPSOLR PRO extensions have been built 100% with WPSOLR hooks. So, you should be able too !

 

Was this helpful?

Leave A Comment
*
*