0

私はこのようなマップされたエンティティを持っています:

{ "Organisation":{
  "properties":{
     "_abstract_":{
        "type":"string",
        "store":"yes"
     },
     "_author_":{
        "type":"string",
        "store":"yes"
     },
     "_editdate_":{
        "type":"date",
        "index":"analyzed",
        "store":"yes",
        "format":"dateOptionalTime"
     },
     "_id_":{
        "type":"string",
        "index":"not_analyzed",
        "store":"yes",
        "omit_norms":true,
        "index_options":"docs"
     },
     "_title_":{
        "type":"string",
        "store":"yes"
     },
     "country":{
        "type":"string",
        "store":"yes"
     },
     "countrycode":{
        "type":"string",
        "index":"not_analyzed",
        "omit_norms":true,
        "index_options":"docs"
     },
     "creationdateutc":{
        "type":"date",
        "index":"analyzed",
        "store":"yes",
        "format":"dateOptionalTime"
     }, ...

CountryCodeは、CNTRY/USのような値を持つことができます。これを照会することはできません。not_analyzedであっても、値を2つのトークンに分割する必要があります。例えば:

{ "query":{
  "bool":{
     "must":[
        {
           "term":{
              "countrycode":"cntry/us"
           }
        }
     ],
     "must_not":[

     ],
     "should":[

     ]
  }},   "from":0,   "size":50}

理解できません。私は何か簡単なことを誤解していますか?

4

1 に答える 1

0

フィールドマッピングで検索ANDインデックスアナライザーを「キーワード」として指定することでこれを解決しました。

また、検索している値に間違った大文字と小文字を使用することで問題を悪化させ (キーワードの場合、値は下げられません)、Head を使用すると、クエリを POST する代わりに GET していました。どっ!

ありがとう

于 2013-02-14T03:24:12.927 に答える