Exact word and full text search togther

Hi,

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 :

  1. This is apple
  2. 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).

Please help me.

Thanks
Tarlok

Hi,

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.

Below is wildcard query:
"query": {
"wildcard": {
"Field1": {
"value": "apple"
}
}
}

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.

Thanks
Tarlok