I've been struggling to make my search work as expected, mainly because I don't know what kind of query I should make to fullfill my needs.
Essentially, what I am looking for, is that the results ideally would only include posts that include every term, but also keep fuzziness applied.
For example, if I look for the term '215 tires' it should bring results like:
- 215 tires
- 217 tires
- 225 tires
- 215 tire
- ...
I am in the process of creating an app and have been learning too many stuff, and Elasticsearch is just a part of it, but it is HUGE. I've done some testing but looks like I am missing something.
Based on my understanding, I would expect something like the following query to work:
$query = array(
'bool' => array(
'should' => array(
array(
'multi_match' => array(
'query' => '',
'fields' => $search_fields,
'boost' => apply_filters( 'ep_match_boost', 2, $search_fields, $args ),
'fuzziness' => 1,
'operator' => 'and',
),
),
);
Obviously I am doing something wrong, because I am not getting the results I am expecting, eg if I search '215 tires' I am getting results also for '215' alone, without any mention of the word 'tires'.
I experimented a lot by the most famous trial and error technique but it bear no fruit. Any help?