2016-06-23 9 views
1

Elasticsearchの_allにfuzzinessを適用する方法があるのだろうかと思います。Elasticsearchの_allへの曖昧さ

私は成功せずに次のクエリを試しました。

curl -XGET localhost:9200/superindex/_search?pretty -d '{"query": {"match": {"_all": "hapiness", "fuzziness": "AUTO"}}, "from": 0, "size": 2}' 

エラーが発生しました。

{ 
    "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" : "carenotes_etl", 
     "line" : 1, 
     "col" : 40 
    } ], 
    "type" : "search_phase_execution_exception", 
    "reason" : "all shards failed", 
    "phase" : "query", 
    "grouped" : true, 
    "failed_shards" : [ { 
     "shard" : 0, 
     "index" : "carenotes_etl", 
     "node" : "cMRfwQ3eS12eVkjfMOHYuQ", 
     "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" : "carenotes_etl", 
     "line" : 1, 
     "col" : 40 
     } 
    } ] 
    }, 
    "status" : 400 
} 

答えて

1

次のクエリは私にとって役に立ちます。

curl -XGET localhost:9200/superindex/_search?pretty -d '{"query": {"multi_match": {"query": "dmentia", "fields": "_all", "fuzziness": "AUTO"}}, "from": 0, "size": 2}'