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

Error when indexing #157

Open thesquaremedia opened 5 years ago

thesquaremedia commented 5 years ago

There was a problem indexing the data. (Content-Type header [application/x-www-form-urlencoded] is not supported) any idea of how to solve it?

thesquaremedia commented 5 years ago

updating this fixed that

static function _client($write = false)
    {
        $settings = array(
            'url' => Config::option('server_url'),
            "headers" => array("Content-Type" => "application/json")
        );

        if ($write) {
            $settings['timeout'] = Config::option('server_timeout_write') ?: 300;
        } else {
            $settings['timeout'] = Config::option('server_timeout_read') ?: 1;
        }

        // Allow custom settings to be passed by users who want to.
        $settings = apply_filters('indexer_client_settings', $settings);

        return new \Elastica\Client($settings);
    }

now I am getting this though There was a problem indexing the data. (failed to parse [post_date])

thesquaremedia commented 5 years ago

so after trying to make it work. it seems the reason I get errors is becuase the plugin isnt compatible with the latest version of elastic search 6.x specially with the changes in multiple index types.