I have a nested type document with following structure.
indexName
-- mapping
-- header
-- nested
-- details is neted in that i have documents like
[{
sub doc 1
},
{
sub doc 2
}] etc..
Now i am checking a query on the text with in details nested field which is using wild card "813-0198" the documents belongs to this field has values like 813-0198-112,813-0198-34etc...
if i search with "813-0198" with nested query can i get the all values contains this string or do we need any special analyzer to search special characters in nested type?please help me in this
This is largely unrelated to the nested structure; it boils down to how the fields were analyzed.
Under the default analyzer (standard), hyphens are stripped out when the strings are tokenized. For example, 813-0198-112 will be tokenized into [" 813", "0198", "112"]
Similarly, when you search for "813-0198", that'll be tokenized into [ "813", "0198"]. So you'll find any document that contained "813" OR "0198".
If you don't want that behavior, you'll need to configure an analyzer that doesn't tokenize on hyphens (and other special characters that you care about).
Thank you for the reply. I am using full text search on this i.e "text". I am using ES 5.1.1 but it is not working as expected can you please tell me in full text search scenario is it possible to make wild card search?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.