fbpx

Can I define multiple searches ?

431 views January 29, 2017 July 13, 2019 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
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Join Our weekly Newsletter

Receive our latest news once a week, each Thursday afternoon.
Your email is kept 100% private, and you will not receive other stuff in your mailbox.

We keep your data private and share your data only with third parties that make this service possible. Read our Privacy Policy.