私はfake index per userに行っていますが、私のユーザーIDは電子メールです。私のエイリアスに@
があると、検索は空です。例えばelasticsearchエイリアシングの禁止文字はありますか?
、私はmy_alias検索が正常に動作していると、私の@ LIASはありませんが、以下のように一つの指標my_index
と2別名my_alias
と[email protected]
を作成する場合:
curl -XPUT 'elasticsearch:9200/my_index'
{"acknowledged":true}
curl -XPUT 'elasticsearch:9200/my_index/_alias/my_alias -d '{"routing": "my_alias", "filter": {"term": {"doc_id": "my_alias"}}}'
{"acknowledged":true}
curl -XPUT 'elasticsearch:9200/my_index/_alias/[email protected]' -d '{"routing": "[email protected]", "filter": {"term": {"doc_id": "[email protected]"}}}'
{"acknowledged":true}
curl -XPUT 'elasticsearch:9200/my_alias/doc/1' -d '{doc_id:"my_alias", title: "hello world"}'
{"_index":"my_index","_type":"doc","_id":"1","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
curl -XPUT 'elasticsearch:9200/[email protected]/doc/2' -d '{doc_id:"[email protected]", title: "hello dude"}'
{"_index":"my_index","_type":"doc","_id":"2","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
curl -XGET 'elasticsearch:9200/my_alias/doc/_search?pretty=true' -d'{"query": {"match": {"title": "hello"}}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.19178301,
"hits" : [ {
"_index" : "my_index",
"_type" : "doc",
"_id" : "1",
"_score" : 0.19178301,
"_routing" : "my_alias",
"_source" : {
"doc_id" : "my_alias",
"title" : "hello world"
}
} ]
}
}
curl -XGET 'elasticsearch:9200/[email protected]/doc/_search?pretty=true' -d'{"query": {"match": {"title": "hello"}}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
何を私に困惑することは一切Invalid Alias Name Exception
がないことです検索結果はOKですが空です。
URLエンコード%40
:elasticsearch:9200/my%40lias
でも試しましたが同じです。
インデックス全体を検索すると、2つのドキュメントが表示されます。 @
でインデックスを作成すると、インデックスの検索も正常です。私がESの状態を見るために_aliasesをカールすると、私はそれを見ることができます:
"my_index" : {
"aliases" : {
"[email protected]" : {
"filter" : {
"term" : {
"doc_id" : "[email protected]"
}
},
"index_routing" : "[email protected]",
"search_routing" : "[email protected]"
},
"my_alias" : {
"filter" : {
"term" : {
"doc_id" : "my_alias"
}
},
"index_routing" : "my_alias",
"search_routing" : "my_alias"
}
}
},
あなたはその動作の何らかの理由がありますか?私は何かが恋しいですか?
oups、私はうーん、それはとしなければならないかもしれません –
ポストを編集していますルーティングを使用している方法。 – Val
でも、それはまさに上記のリンクと同じで、1つではなく他のものと一緒に働いています... –