2017-08-29 6 views
0

私のelasticsearchバージョンは2.4です。よくある質問はデータを取得しません

私はこのクエリを使用していますが、これは空白の配列を与えています。 誰かが私が間違っていた場所を見つけるのを助けます。

curl -XGET 'localhost:9200/stores/store/_search?pretty' -H 'Content-Type: application/json' -d' 
{ 
"query": { 
    "common": { 
    "body": { 
    "query": "donald trump for president", 
    "cutoff_frequency": 0.1 
    } 
    } 
    } 
}' 

OUTPUT:

"took" : 6, 
    "timed_out" : false, 
    "_shards" : { 
    "total" : 3, 
    "successful" : 3, 
    "failed" : 0 
    }, 
    "hits" : { 
    "total" : 0, 
    "max_score" : null, 
    "hits" : [ ] 
    } 
} 
+0

クエリは正常です。あなたのマッピングと、このクエリで見つけると思われるサンプルの例を表示できますか? "マッピング":{"インデックス":{"number_of_shards":6、 "number_of_replicas":1}}: – dshockley

+0

curl -XPUT 'http:// localhost:9200/new_stopwords /' -d '{"設定" "" {"type": "text"、 "boost":2}、 "description":{"type": " "text"}}}}} ' – Ganesh

答えて

1

あなたが存在しないフィールド(body)を照会しているように見えます。マッピングに存在するフィールドを照会するか、_all

{ 
"query": { 
    "common": { 
    "_all": { 
    "query": "donald trump for president", 
    "cutoff_frequency": 0.1 
    } 
    } 
    } 
} 
+0

ありがとう... @dshockley – Ganesh

関連する問題