Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
FuzzyLikeThisQuery.md 863 B

Fuzzy Like This Query

DEPRECATED: this query is deprecated and will be removed in ElasticsearchDSL 2.0

More info about fuzzy like this field query is in the official elasticsearch docs

Fuzzy like this query find documents that are "like" provided text by running it against one or more fields.

Simple example

{
    "fuzzy_like_this" : {
        "fields" : ["name.first", "name.last"],
        "like_text" : "text like this one",
        "max_query_terms" : 12
    }
}

In DSL:

$fuzzyLikeThisQuery = new FuzzyLikeThisQuery(
    ['name.first', 'name.last'],
    'text like this one',
    [ 'max_query_terms' => 12 ]
);

$search = new Search();
$search->addQuery($fuzzyLikeThisQuery);

$queryArray = $search->toArray();