2017-03-09 2 views
0

私はMatch_phraseオプションを使用しているため、特定のテキストと一致させたいのですが、一部のフィールドはデフォルトで分析されませんので、アナライザフィールドはmatch_phraseクエリで渡されます。私は以下のクエリを使用していた場合Elasticsearch 2.4.1のMatch_phraseクエリエラー?

それがエラーを示している。

POST data/_search 
{ "size":50, 
"query":{ 
    "bool":{ 
     "must":[ 
      { 
    "term":{ 
     "region":"USA" 

    }}, 
     { 
     "match_phrase":{ 
    "university":"University of michigan", 
    "analyzer": "standard" 
     } 
     }, 

     { 
     "match_phrase":{ 
    "games":"football and basketball", 
     "analyzer": "standard" 
     } 
     } 
     ] 
    } 
} 
} 

エラーは次のとおりです。

"error": { 
     "root_cause": [ 
     { 
      "type": "query_parsing_exception", 
      "reason": "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?", 
      "index": "data", 
      "line": 13, 
      "col": 3 
     } 
     ], 
     "type": "search_phase_execution_exception", 
     "reason": "all shards failed", 
     "phase": "query", 
     "grouped": true, 
     "failed_shards": [ 
     { 
      "shard": 0, 
      "index": "data", 
      "node": "9pSi8WYdRRuVrmLjWoGqcg", 
      "reason": { 
       "type": "query_parsing_exception", 
       "reason": "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?", 
       "index": "data", 
       "line": 13, 
       "col": 3 
      } 
     } 
     ] 
    }, 
    "status": 400 
} 

私はそれが正常に動作しているmatch_phraseフィールドにアナライザーを削除します。 問題がどこにあるか分かりますか?

おかげ

答えて

0

ので、代わりの:

"match_phrase":{ 
    "university":"University of michigan", 
    "analyzer": "standard" 
} 

あなたが行う必要があります。

"match_phrase":{ 
    "university":{ 
    "query": "University of michigan", 
    "analyzer": "standard" 
    } 
}  
+1

Thankyou..itが働いていました – Seeker