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"]
}
なぜ次のクエリは結果を返さないのですか? 2番目のクエリで、私は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。今すぐ最初のクエリが動作します。なぜ2番目のものは私に全く結果を与えませんか? – betto86
@ betto86このリンクを確認してくださいhttps://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html –