Skip to content

Instantly share code, notes, and snippets.

@rsmarshall
Created July 2, 2014 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsmarshall/4c2d43ff859dfebb9faa to your computer and use it in GitHub Desktop.
Save rsmarshall/4c2d43ff859dfebb9faa to your computer and use it in GitHub Desktop.
$return = $this->_client->search(
array(
'index' => self::INDEX,
'type' => self::TYPE,
'body' => array(
'query' => array(
'bool' => array(
'must' => array(
'multi_match' => array(
'query' => $query,
'fields' => array('name', 'brand', 'description'),
'boost' => 10,
),
'fuzzy_like_this' => array(
'like_text' => $query,
'fields' => array('name', 'brand', 'description'),
'fuzziness' => 1,
),
),
),
),
'size' => '5000',
),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment