mikaelmattsson / elasticsearch-indexer

Index WordPress posts and post meta data using Elasticseach.
GNU General Public License v2.0
43 stars 5 forks source link

"Syntax Error" when try to start sync #13

Open Kryuko opened 6 years ago

Kryuko commented 6 years ago

Same as the title... I installed everything right, then i ran the first sync and everything was ok. Then i tried to redo the sync and i get "syntax error" with no log.

Thank you in advance. ElasticSearch 6.1.1 WP 4.8.4

ericleonardo commented 6 years ago

I'm experiencing the same "syntax error" when clicking to "Reindex All Posts". Connection is OK. The first time ran ok. But I changed Integration to "Search Only" (Full Integration caused blank site). PHP Log: `[22-Apr-2018 18:06:58 UTC] PHP Fatal error: Uncaught Guzzle\Http\Exception\ClientErrorResponseException: Client error response [status code] 400 [reason phrase] Bad Request [url] http://127.0.0.1:9200/hotsalenet-1/post/_search in /home/hotsale/public_html/wp-content/plugins/elasticsearch-indexer/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43

Stack trace:

0 /home/hotsale/public_html/wp-content/plugins/elasticsearch-indexer/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response))

1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))

2 /home/hotsale/public_html/wp-content/plugins/elasticsearch-indexer/vendor/symfony/event-dispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatc in /home/hotsale/public_html/wp-content/plugins/elasticsearch-indexer/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php on line 277`

stevenmunro commented 6 years ago

I also have this issue. Is this plugin still being maintained?

ericleonardo commented 6 years ago

No, this plugin is not being maintained... Now I'm using another great plugin: ElasticPress. I'm very happy.. it's free and works perfectly for me. https://github.com/10up/ElasticPress

After you install it, go to ElasticPress tab on WordPress and click on gear icon on top right, then insert your Elasticsearch host address. In my case it was localhost: http://127.0.0.1:9200 (maybe should open 9200 port on firewall, don't know). Despite my site is https, my Elasticsearch is on http. Save, and then Sync database for first run clicking on refresh icon on top right. Ignore the message: "Your Elasticsearch version 6.2.4 is above the maximum required Elasticsearch version 6.1. ElasticPress may or may not work properly." I'm using 6.2.4 and works despite ElasticPress keeps showing that warning.

Click on ElasticPress tab again to see its Status. "Search" status should be green. Now every search is automatically done by ElasticPress, simple as that. You should have Elasticsearch installed and configured first: https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html