Elastic index analyzed but not searchable


#1

I loaded sample data below using a template. The "str_type_analyzed" field is set to "analyzed". However, in Kibana 4 I do not get any hits when I search for "red". It does not matter if I type use double quotes or not. I have loaded other data w/o templates and had no problem with searches. When I use visualize I can see that this field was tokenized. Any help is appreciated. Thanks, Frank.

My two rows of data:
1ABC|2015-08-11 08:52:10.052|123|500.25|"This car is red"|"Red Ford"
2DEF|2015-07-11 08:52:10.052|456|200.25|"This car is blue"|"Blue Ford"

my template:

{
"template" : "maptest",
"order": 1,
"mappings" : {
"default" : {
"_all" : {"enabled" : false},
"properties" : {
"pk_col": { "type": "string", "index": "not_analyzed","doc_values" : true },
"dt_type": { "type": "date", "index": "not_analyzed", "format": "yyyy-MM-dd HH:mm:ss.SSS", "doc_values" : true},
"int_type": { "type": "integer","doc_values" : true },
"float_type": { "type": "float","doc_values" : true },
"str_type_analyzed": { "type": "string" , "index": "analyzed" },
"str_type_not_analyzed": { "type": "string", "index": "not_analyzed" ,"doc_values" : true }
}
}
}
}


(Adrien Grand) #2

Can you rmake a recreation of the problem using either Sense or a bash script with curl commands?


#3

Hi Adrien,

I new to ES. I am running this on my Windows laptop for now. I can create a batch file with the curl in it. Does that work?


(Adrien Grand) #4

Yes, that would work for me.


#5

Adrien.... I think I figured it out. Stumbled onto it while re-reading the docs again.... look likes " _all" is used for searches if no field is specified.

For example: it returns data when I use curl -XGET http://localhost:9200/maptest/_search?q=str_type_analyzed:blue. However, I do not get data when a field is not specified.

So I updated my template to include: "_all" : {"enabled" : true} and re-freshed ES.

Now when I type in "blue" in the Kibana search bar I get a hit.

Regards,
Frank


(Adrien Grand) #6

I'm happy you figured it out. Thanks for sharing your fix!


(system) #7