You could do a hack with the field type similar to this text_lower_exact type:
But if you only do the hack on the “index” side of analysis, you are free to do
phrase searches like “ǣ DEF” which would only match the beginning since you
include the very first token in the phrase.
It is not a perfect solution, and I’d like a native query operator to handle
it, but so far we have not got one.
You may also try regex query, like myfield:/^DEF/
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
> 21. sep. 2016 kl. 08.06 skrev Mahmoud Almokadem <prog.mahm...@gmail.com>:
> What is the best way to search with the start token of field?
> For example: the field contains these values
> Document1: ABC DEF GHI
> Document2: DEF GHI JKL
> when I search with DEF, I want to get Document2 only. Is that possible?