I'm having trouble figuring out how the query (search) the 'stored' form of
a field that has an analyzer. I need to be able to search for both the
unmodified words, and the synonym mapping I've created at different times.
Take, for example, the following:
{
"settings" : {
"analysis" : {
"analyzer" : {
"name_synonym" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["lowercase", "name_synonym"]
}
},
"filter" : {
"name_synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/name_synonyms.txt"
}
}
}
},
"mappings" : {
"record" : {
"properties" : {
"name" : { "type" : "string", "analyzer" : "name_synonym",
"store" : "yes" }
}
}
}
}
What would I use in my query to indicate that it should only query the
stored form, and not the analyzed form? That is to say in this example, I
sometimes want to query for "Chris," and have "Kris," match (works in a
normal field query with the analyzer in-place), but other times I only want
to match "Chris" (doesn't work with the analyzer in place).
The current, relevant section of my query looks like this, which searches
the analyzed form.
{
'fquery' => {
'_name' => 'recordName',
'query' => {
'field' => {
'name' => 'chris'
}
}
}
}
Any advice would be greatly appreciated!
--
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.
For more options, visit https://groups.google.com/groups/opt_out.