Thanks all, I think SpapnFirstQuery will solve my problem. But does Solr 4.8 supports xmlparser to use it? and does SpanFirst supports phrase search instead of single term?
Thanks, Mahmoud On Wed, Sep 21, 2016 at 10:45 AM, Markus Jelsma <markus.jel...@openindex.io> wrote: > 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 >