のための単語を分割するために使用されていない私は、インデックス文書のマッピングを以下している(簡体字)ドットがアナライザ
{
"documents": {
"mappings": {
"document": {
"properties": {
"filename": {
"type": "string",
"fields": {
"lower_case_sort": {
"type": "string",
"analyzer": "case_insensitive_sort"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
}
私は、このインデックス
{
"_index": "documents",
"_type": "document",
"_id": "777",
"_source": {
"filename": "text.txt",
}
}
に二つの文書を置きます。..
{
"_index": "documents",
"_type": "document",
"_id": "888",
"_source": {
"filename": "text 123.txt",
}
}
"text"に対してquery_stringまたはsimple_query_stringクエリを実行すると、両方のドキュメントを取得することが予想されます。b ack。ファイル名が "text.txt"と "text 123.txt"のために一致する必要があります。私が検索した場合にのみ発見された「test.txtの」または「test.txtの」または「テスト -
http://localhost:9200/defiant/_search?q=text
しかし、私は名前だけ「テスト123.txt」との文書を見つける「テスト*。」 。??? " - ファイル名にドットを追加する必要があります。 >
{
"_index": "documents",
"_type": "document",
"_id": "777",
"matched": false,
"explanation": {
"value": 0.0,
"description": "Failure to meet condition(s) of required/prohibited clause(s)",
"details": [{
"value": 0.0,
"description": "no match on required clause (_all:text)",
"details": [{
"value": 0.0,
"description": "no matching term",
"details": []
}]
}, {
"value": 0.0,
"description": "match on required clause, product of:",
"details": [{
"value": 0.0,
"description": "# clause",
"details": []
}, {
"value": 0.47650534,
"description": "_type:document, product of:",
"details": [{
"value": 1.0,
"description": "boost",
"details": []
}, {
"value": 0.47650534,
"description": "queryNorm",
"details": []
}]
}]
}]
}
}
私はマッピングを台無しにしました -
これは私のドキュメントID 777(TEXT.TXT)
curl -XGET 'http://localhost:9200/documents/document/777/_explain' -d '{"query": {"query_string" : {"query" : "text"}}}'
は反対の結果を説明するのですか?私は、 '。 ...文書がインデックス化された用語の区切りとして解析され
編集:case_insensitive_sortのセッティング
{
"documents": {
"settings": {
"index": {
"creation_date": "1473169458336",
"analysis": {
"analyzer": {
"case_insensitive_sort": {
"filter": [
"lowercase"
],
"tokenizer": "keyword"
}
}
}
}
}
}
}
あなたは 'case_insensitive_sort'の設定(トークナイザ、フィルタ)を提供できますか? – ChintanShah25
元の質問を更新しました。デフォルトのアナライザをクエリに適用する必要があるため、これが適切かどうかは不明です。 "case_insensitive_sort"はfilenameのサブフィールドでのみ使用されます。 Resp。 filename.lower_case_sort。 –