私は弾性検索の初心者です。私はここ数日から実験しています。私はマッピングで言及したすべてのデータ型がそれぞれの型の代わりに "型"型にマップされているので、適切なマッピングを行うことができません。ここで私はマッピングをテストするには弾性検索 "word"データタイプ:マッピングが正しくない
POST my_index
{
"settings" : {
"analysis" : {
"analyzer" : {
"lowercase_analyzer" : {
"type" : "custom",
"tokenizer" : "keyword",
"filter" : ["lowercase"]
}
}
}
},
"mappings" : {
"my_type" : {
"properties" : {
"name" : {"type" : "string" ,"index" : "not_analyzed" },
"field0" : {
"properties" : {
"field1" : {"type" : "boolean" },
"field2" : {"type" : "string" },
"field3" : {"type" : "date", "format" : "yyyy-MM-dd HH:mm:ss SSSSSS" }
}
}
}
}
}
}
を行っているマッピングは、私は私に次のような結果
{
"tokens": [
{
"token": "10.90.99.6",
"start_offset": 0,
"end_offset": 10,
"type": "word",
"position": 0
}
]
}
を与える
GET my_index/_analyze
{
"field" : "name",
"text" : "10.90.99.6"
}
を次のように私は「_analyze」APIを使用しています、です結果の中の「型」が「文字列」であると予想します。しかし、なぜタイプ "単語"が戻ってくるのか理解できませんでした。 _analyze apiを使ってネストされたフィールドにブール型またはタイムスタンプ型のデータをポストすると、他のフィールドでも同じことが起こります。
GET my_index/_analyze
{
"field" : "field0.field1",
"text" : "true"
}
結果、私は私のマッピングで間違ってやっている
{
"tokens": [
{
"token": "true",
"start_offset": 0,
"end_offset": 4,
"type": "word",
"position": 0
}
]
}
。
また、elastic search reference apiには、このような「ワード」データ型はありません。
ありがとうございます。それは助けになった。 –
Cool。うれしかったよ! – Val