Advice on mapping/searching with lowercase

Hi,

I'm trying to figure out the correct mapping for searching for exact values
but lowercased. I thought this would work:
....
"exact_lowercase": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "keyword"
}
......

and the mapping of the field:
"TITLE": {
"fields": {
"exact_lowercase": {
"search_analyzer": "keyword",
"index_analyzer": "exact_lowercase",
"type": "string"
},
...some other mapping....
},
"type": "multi_field"
}

but when i do a termquery or query_string query i'm not getting any hits,
for example "steel wheels". The original value: "Steel Wheels". What am i
doing wrong. The idea for the searchstrategy is to first match on exact
lowercase strings, if nothing is found we do a partial match.

Thanks,
Maarten

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/27936be4-3c41-4837-bdd4-01e765d7aa3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

At index time, you are using your exact_lowercase analyzer. "Steel Wheels" is indexed as "steel wheels".

When searching for "steel wheels" it obviously does not match.

Why not using the same analyzer at search and index time?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 20 janv. 2015 à 09:28, Maarten Roosendaal mroosendaal14@gmail.com a écrit :

Hi,

I'm trying to figure out the correct mapping for searching for exact values but lowercased. I thought this would work:
....
"exact_lowercase": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "keyword"
}
......

and the mapping of the field:
"TITLE": {
"fields": {
"exact_lowercase": {
"search_analyzer": "keyword",
"index_analyzer": "exact_lowercase",
"type": "string"
},
...some other mapping....
},
"type": "multi_field"
}

but when i do a termquery or query_string query i'm not getting any hits, for example "steel wheels". The original value: "Steel Wheels". What am i doing wrong. The idea for the searchstrategy is to first match on exact lowercase strings, if nothing is found we do a partial match.

Thanks,
Maarten

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/27936be4-3c41-4837-bdd4-01e765d7aa3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/81D6E9F6-F61B-4AB2-B9D1-40E601F77C13%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.