parisholley / wordpress-fantastic-elasticsearch

Improve wordpress search performance/accuracy and enable faceted search by leveraging an ElasticSearch server.
MIT License
162 stars 64 forks source link

No search results, wordpress in subdirectory #127

Closed trueinviso closed 8 years ago

trueinviso commented 8 years ago

Will this plugin work if wordpress is in a subdirectory?

The query generated by the plugin always returns no results for a search. The SQL statement generated by the query:

SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (0) AND wp_posts.post_type IN (\'post\', \'page\', \'attachment\', \'events\', \'testimonies\', \'leadership\') AND (wp_posts.post_status = \'publish\' OR wp_posts.post_author = 1 AND wp_posts.post_status = \'private\') ORDER BY wp_posts.post_type ASC LIMIT 0, 500'

It always has wp_posts.ID IN (0) which would seem to always be false? Maybe this is how the plugin overrides wordpress default search? All the posts are in elasticsearch and I am able to run queries on the data from the command line. I am new to elasticsearch and this plugin, maybe I am missing something simple?

peussen commented 8 years ago

From what i understand from the plugin, this plugin will use elasticsearch to obtain a list of ID's it should show. It then hands it over to wordpress to get the actual posts, using the query you show. So that it tries to match to 0, means the original elasticsearch query failed.

I run the plugin on a site with wordpress in a subdir as well and that works ok. So i doubt it has to do with that. Can you check there are actually records in your elasticsearch?

trueinviso commented 8 years ago

There are records in eleasticsearch. I was able to get the plugin elasticpress working, so I'm using that instead now. I liked the back end UI for this plugin but couldn't get it working :(.