3
어떻게하면이 쿼리가 작동하는지 (ES 2.X) 더 잘 이해하려고합니다. 다음 용어 색인을 생성했습니다.Elasticsearch More 이와 비슷한 결과가 없습니다.
PUT /test_index
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"text": {
"type": "string",
"term_vector": "yes"
}
}
}
}
}
PUT /test_index/doc/1
{
"text": ["Hello","World"]
}
PUT /test_index/doc/2
{
"text": ["This","is","me"]
}
PUT /test_index/doc/3
{
"text": ["Hello","World"]
}
PUT /test_index/doc/4
{
"text": ["Hello","World","World"]
}
다음 쿼리가 결과를 반환하지 않는 이유는 무엇입니까? 두 번째 쿼리와 나는 1
POST /test_index/doc/_search
{
"query": {
"more_like_this": {
"like": "Hello",
"min_term_freq": 1
}
}
}
POST /test_index/doc/_search
{
"query": {
"more_like_this": {
"fields": [
"text"
],
"like": [
{
"_index": "test_index",
"_type": "doc",
"_id": "1"
}
]
}
}
}
감사합니다. vinod_vh. 이제 첫 번째 쿼리가 작동합니다. 두 번째 이유는 전혀 결과를주지 않는 이유는 무엇입니까? – betto86
@ betto86이 링크를 확인하십시오. https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html –