Yes, definately SpanFirstQuery! But i didn't know you can invoke it via XMLQueryParser, thank Mikhail for that!
There is a tiny drawback to SpanFirst, there is no gradient boosting depending on distance from the beginning. Markus -----Original message----- > From:Mikhail Khludnev <m...@apache.org> > Sent: Wednesday 21st September 2016 9:24 > To: solr-user <solr-user@lucene.apache.org> > Subject: Re: Search with the start of field > > You can experiment with {!xmlparser}<SpanFirst>.. see > https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-XMLQueryParser > > On Wed, Sep 21, 2016 at 9:06 AM, Mahmoud Almokadem <prog.mahm...@gmail.com> > wrote: > > > Hello, > > > > 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? > > > > Thanks, > > Mahmoud > > > > > -- > Sincerely yours > Mikhail Khludnev