Reputation: 596
My documents for ElasticSearch are of the form:
{
"message": "Message text",
"user_email": "user@email.net"
}
There are two types of queries executed against these documents:
Is there a way to create both 'analyzed' and 'not_analyzed' indexes for a single field in ElasticSearch?
Upvotes: 1
Views: 277
Reputation: 2360
A simple solution to the above problem is to define two different fields corresponding to user_email, i.e., "user_email_analyzed" and "user_email_not_analyzed" when creating the index. Afterwards, during the indexing phase, you should update the context on both email fields.
Upvotes: 1