Thursday, 15 April 2010

elasticsearch and not_analyzed - STIll cant find stuff -



elasticsearch and not_analyzed - STIll cant find stuff -

i have mapped entity this:

{ "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 can have values cntry/us. cannot query - still wants split value 2 tokens though it's not_analyzed. eg:

{ "query":{ "bool":{ "must":[ { "term":{ "countrycode":"cntry/us" } } ], "must_not":[ ], "should":[ ] }}, "from":0, "size":50}

i dont it. misunderstanding simple?

i solved specifying search , index analyzer 'keyword' in field mapping.

i compounded problems using wrong case values searching (when keyword, values not lowered) , when using head getting query instead of posting it. doh!

thanks

elasticsearch

No comments:

Post a Comment