Hi All,
I would like to perform case insensitive search on not_analyzed field, as
well as I would like to provide support for wildcard search. And, wildcard
search is not working on keyword analyzer.
Also, I tried by using query string query, but it would not giving expected
search result.
Thanks,
Ankit Jain
--
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.
Ankit,
You'll need to analyze a field to search case-insensitive.
You can always use multi-field mapping and create two mappings for one
field: One of the mappings is analyzed one way (such as the way you need to
search), and the other is analyzed differently or not at all.
Brian
On Wednesday, July 3, 2013 9:39:54 AM UTC-4, Ankit Jain wrote:
Hi All,
I would like to perform case insensitive search on not_analyzed field, as
well as I would like to provide support for wildcard search. And, wildcard
search is not working on keyword analyzer.
Also, I tried by using query string query, but it would not giving
expected search result.
Thanks,
Ankit Jain
--
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.
The mapping for such a scenario would like like this:
{
type_name: {
properties: {
type: "multi_field",
fields: {
field_name_searchable: { type: "string" },
field_name_untouched: { type: "string", index: "not_analyzed" }
}
}
}
}
If you take a look at the Standard Analyzer page, you'll notice that case insensitive search is enabled by default (with the Lowercase tokenizer). The mapping defined above will allow you to perform wildcard and case-insensitive search on "field_name_searchable" as well as giving you literal matches on "field_name_untouched".
Hope that answers your question.