Elasticsearch “More Like This” API vs. more_like_this query

后端 未结 2 1885
迷失自我
迷失自我 2020-12-07 14:53

Elasticsearch has two similar features to get \"similar\" documents:

There is the \"More Like This API\". It gives me documents similar to a given one. I can\'t use

2条回答
  •  渐次进展
    2020-12-07 15:41

    This is possible now with the new like syntax:

    {
        "more_like_this" : {
            "fields" : ["title", "description"],
            "like" : [
            {
                "_index" : "imdb",
                "_type" : "movies",
                "_id" : "1"
            },
            {
                "_index" : "imdb",
                "_type" : "movies",
                "_id" : "2"
            }],
            "min_term_freq" : 1,
            "max_query_terms" : 12
        }
    }
    

    See here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html

提交回复
热议问题