Fuzzy query is returning all documents


#1

No matter what keyword I pass in, I get all of my documents in the response. Even those not matching my search criteria.

Here is the PHP code:

$params = [
'index' => 'ats_search_engine',
		'body' => [
		'query' => [
			'fuzzy' => [
				'_all' => $keyword
					]
				]
			]
		];
		
		$response = $client->search ( $params );

Not sure why this is happening?


#2

Seems the PHP array way of constructing the request is not working for me.
I decided to try this, which worked:

	$json = '{
    "query" : {
        "match" : {
            "title" : "members"
        }
    }
}';
	
$params['index'] = 'ats_search_engine';
$params['type'] = 'thoracic';
$params['body'] = $json;

So, just to repeat, the array way of doing things is not working for me.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.