T
T
theEternalStudent2017-09-06 16:51:48
elasticsearch
theEternalStudent, 2017-09-06 16:51:48

How to make multi-word search work in elasticsearch if the words are not together?

It doesn't work with these settings:

$params = [
        'index' => 'myapp',
        'type' => 'post',
        'size' => 10,
        'from' => 10,
        'body' => [
            'query' => [
                'match_phrase_prefix' => [
                    'post_title' => [
                        "query" => $_POST['test'],
                        'analyzer' => 'russian'
                    ]
                ]
            ],
            'sort' => [
                'post_title' => [
                    'order' => 'DESC'
                ]
            ]

        ]
    ];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2017-09-06
@dimonchik2013

distance
https://www.elastic.co/guide/en/elasticsearch/guid...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question