So you want ES to index field without tokenizing its content.
A keyword analyzer will do it. By default, ES use the standard analyzer.
That's the first proposal I wrote.
You have to define it at index time. If ES has already tokenized the field, you won't be able to search exact sentence.
Does it answer to your needs ?
David
Twitter : @dadoonet / @elasticsearchfr
Le 22 mars 2012 à 15:26, Marcin Dojwa m.dojwa@livechatinc.com a écrit :
Hi thanks, but I think you misunderstood me. As I understand your examples will find all the documents with fields containing all of the given words 'how', 'are' and 'you', so the matching fields would be:
- How are you today?
- How something you anything are something else.
- ...
right ?
But I want to find the fields that contains exactly 'how are you' so the matching 1 from above would be the only correct match.
Best regards.
2012/3/22 david@pilato.fr david@pilato.fr
You can define a keyword mapping. ES won't touch what you index.
Or you can define to use a AND operator instead of OR (default) in your query
Or you can use lucene syntax to query on +how +are +you
I think that there are many other ways to do it...
HTH
David.
Le 22 mars 2012 à 14:41, Marcin Dojwa m.dojwa@livechatinc.com a écrit :
Hi,
I have a following question. Is it possible for Elasticsearch to index text fields to allow searching complex terms like 'how are you'? I would like to find documents with fields containing exact term 'how are you', not only words 'how', 'are' and 'you'. How should I index such fields to allow searching like this, and how should I build such a request?
Thanks for help.
Best regards.
Marcin.
--
David Pilato
http://dev.david.pilato.fr/
Twitter : @dadoonet