2017-07-06 15 views
-2

私はELに慣れていないため、このデータは「type:」:「load」に基づいて検索したいと考えています。いくつかのフィールドに基づいて弾性検索の検索データ

{ 
    "took": 14, 
    "timed_out": false, 
    "_shards": { 
     "total": 5, 
     "successful": 5, 
     "failed": 0 
    }, 
    "hits": { 
     "total": 1109, 
     "max_score": 1, 
     "hits": [ 
     {"_index": "4", 
      "_type": "aa", 
      "_id": "xx", 
      "_score": 1, 
      "_source": { 
       "useRange": false, 
       "Blueprint": 4, 
       "standardDeviation": 0, 
       "occurrences": 0, 
       "type:": "load", 
       }... 
       { 
       } 
+0

として働く可能性があります取り組んでいるあなたは何を試してみましたか? –

答えて

0

問題は、私たちがtypemetricsに、クエリの下に名前を変更するには、フィールド名「タイプ」とあったが 私のものの種類がキーワード

" GET /4/_search 
{ 
    "query": { 
    "term" : { "typemetrics" : "load"} 
    } 
} " 
2

Elasticsearchドキュメントがお手伝いします助けてください: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html

EDIT

クエリはcurl -XGET 'localhost:9200/sample/_search?q=type:load&pretty'

され、出力が

になります210
{ 
    "took" : 1, 
    "timed_out" : false, 
    "_shards" : { 
    "total" : 5, 
    "successful" : 5, 
    "failed" : 0 
    }, 
    "hits" : { 
    "total" : 1, 
    "max_score" : 0.30685282, 
    "hits" : [ { 
     "_index" : "sample", 
     "_type" : "data", 
     "_id" : "1", 
     "_score" : 0.30685282, 
     "_source" : { 
     "useRange" : false, 
     "Blueprint" : 4, 
     "standardDeviation" : 0, 
     "occurrences" : 0, 
     "type" : "load" 
     } 
    } ] 
    } 
} 
+0

は、タイプを検索するときに正確なクエリ – Manish

+0

を与えることができれば本当に感謝しています。それはあなたに構文エラーを与えるでしょう:それをタイプから削除し、esインデックスにそのレコードを保存し、 –

関連する問題