Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Integrating with Elasticsearch
This topic contains 2 replies, has 2 voices, and was last updated by Marto 8 years, 5 months ago.
- AuthorPosts
- March 14, 2016 at 8:43 pm #8014
Dear Team,
At some stage, we would like to use ASP with an Elasticsearch endpoint.
Will any future update offer this feature, otherwise, would you please let us know what function we may rewrite ? (simple guideline will suffice.)
Thank you,
Best regards.
March 16, 2016 at 9:03 am #8019Hi!
I’m afraid this might not be implemented any time soon yet.
The search handlers are currently in a re-factoring stage, at some point the current structure will change, as it’s a bit outdated. Right now the search process is controlled by a wrapper class: includes/classes/search/search.controller.class.php file.
This then instantiates the required classes for searching within posts, tags, users etc.. and then merging them together etc..You want to edit the function search() .. in this file. In your case you probably only need the first five line of this function and the return statement, so it would look like this to start with:
function search() { $this->parseOptions(); $sd = &$this->args['instance']['data']; // Search options array $s = $this->args['phrase']; // Search phrase $id = $this->args['id']; // Search instance ID $results = array(); // Do your stuff here return $results; }
Try var_dump($results); in the original file first to see how the results structure looks like – you will need to convert the elastic search results to this structure, it’s an array of result objects. And that’s it basically.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 16, 2016 at 9:45 pm #8027Dear Ernest,
Many thanks for your quick and very useful reply,
Best regards.
- AuthorPosts
You must be logged in to reply to this topic.