How to query the WPSOLR results in my theme?
-
finalwebsitesParticipant3 years, 4 months ago #16785
Hi,
I would like to use some queries in my WordPress theme, for example to get some related posts.
Using the free version of Yith woocommerce ajax search widget I noticed that it works very well using the get_posts() function. If I use the same function somewhere only the title and description are search.So what is the official way to create a query in my WP Theme to receive results from WPSOLR?
Is there a filter I can use?finalwebsitesParticipant3 years, 4 months ago #16787I don’t wanna use a different plugin for that (definitively not Toolset).
Is there no way to do that using PHP code? Any documentation for developers?finalwebsitesParticipant3 years, 4 months ago #16789You say that there is no way to select simply 5 products based on a search query from WPSOLR.
Just be some PHP code? Or using WP functions?
Please explain why the get_posts() function works this way in the YITH ajax search plugin.
I tried it and the function can search on custom field values which are only indexed by WPSOLRwpsolrKeymaster3 years, 4 months ago #16790There is no official way, no.
It has been done in the plugin, but in very specific conditions.
You can read the YITH Ajax search add-on code if you want. But it remains internal code, and it can change in the future. Unless you use the predefined actions/filters that you can find also in the add-on code.
- This reply was modified 3 years, 4 months ago by wpsolr.
You must be logged in to reply to this topic.