There are a few ways to achieve what you want.
First of all, all the concepts related to search stem from Lucene. You can
learn more about searching in ElasticSearch, but reading about Lucene.
Second, is case important to you? Your goal is to create an analyzer that
creates tokens that helps you achieve your queries. This could entail not
lowercasing, stemming, and removing stop words.
Easiest way is using phrase queries:
sure you use a correct analyzer.
You can also using span queries with a slop of 0:
On Mon, Nov 5, 2012 at 7:26 AM, shannu email@example.com wrote:
I would like to perform EXACT Match (Example Search : "Firstname
Lastname") in a String field "ArticleBody" where the value of the field
is a big chunk of text and within in this text I would like to perform
the exact match.
I came across couple of links:
which explains that if we change the mapping of the filed to
"not_analyzed", then the entire field value will be considered as one
string and I understand that this will only work where the field values are
2-3 words and wanted to be considered as one single term.
But in my case the Field "ArticleBody" will contain a very big chunk of
text(I dont want to treat the entire body of the article as single string)
and would like to find specific keywords(like: "Elastic Search", "Firstname
Lastname") within this text.
Can this be done ? Please shed some light on this.
Many thanks in advance,