while indexing we are elastic press plugin in wordpress and we are using elastic search for website searching.
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unrecognized character escape '&' (code 38)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@5c05c49d; line: 7, column: 188]"}]
[11-Dec-2019 14:50:46 America/Los_Angeles] PHP Fatal error: Uncaught Elasticsearch\Common\Exceptions\ServerErrorResponseException: {"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unexpected character ('Ã' (code 237)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@7bcfef75; line: 6, column: 153]"}],
The above errors is generated in php error logs.
we are using below coding structure for elastic search.
$json = '{
"from": '.$data->from.',
"size": 30,
"query": {
"multi_match": {
"query": "' . $searchstring . '",
"type": "most_fields",
"fields": [
"post_title",
"post_content",
"custom.cat_name",
"custom.series_name",
"custom.topic_name",
"custom.genre_name",
"post_author.display_name",
"post_meta.wps_subtitle",
"terms.post_tag.name"
],
"fuzziness": "1"
}
},
"post_filter": {
"term": {
"custom.pos_format": "aside"
}
}
}';
$params = [
'index' => 'devarrecoin-1',
'type' => 'post',
'body' => $json
];
$results = $client->search($params);
Note: wordpress elastic press plugin Version 2.8.2,
Elasticsearch-PHP Branch : 2.0
Elastic search version 5.6.16
can you please suggest me.