I want to activate exact word and full text search simultaneously. Exact word search is working fine with not_analyzed index and fulltext search is working fine with analyzed index. Now I want to combine both these. Below is example what exactly I want:
Suppose I have two records :
This is apple
apple
If user search for "apple" then there should be one result (exact word search) but if user search for "apple*" then there must be two records (full text search).
I am able perform both exact word and full-text search. I have mapped fields to not_analyzed index then using wildcard for full-text and filter/terms for exact search. So I am done almost all stuff. Now last issue I am facing how to use wildcard for multiple fields.
I have multiple fields Field1,Field2....FieldN. I have to search same value for all fileds. I tried:
"query": {
"wildcard": {
"Field1": {
"value": "apple"
} ,
"Field2": {
"value": "apple"
}
}
}
but it only shows result of last field (in above case Field2).
Actually I don't want to make queries for all fields and combine there result to a single resultset. I think there must be single query to get result of all fields. Please help me.
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.