Re: Search with the start of field

2016-09-21 Thread Mahmoud Almokadem
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}.. 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
>


RE: Search with the start of field

2016-09-21 Thread Markus Jelsma
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}.. 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


Re: Search with the start of field

2016-09-21 Thread Jan Høydahl
You could do a hack with the field type similar to this text_lower_exact type: 
https://github.com/cominvent/exactmatch/blob/master/conf/schema.xml 

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 :
> 
> 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 
> 



Re: Search with the start of field

2016-09-21 Thread Mikhail Khludnev
You can experiment with {!xmlparser}.. see
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-XMLQueryParser

On Wed, Sep 21, 2016 at 9:06 AM, Mahmoud Almokadem 
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


Re: Search with the start of field

2016-09-21 Thread William Bell
Show us the FieldType and Field definitions.

On Wed, Sep 21, 2016 at 12:06 AM, Mahmoud Almokadem 
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
>
>


-- 
Bill Bell
billnb...@gmail.com
cell 720-256-8076


Search with the start of field

2016-09-21 Thread Mahmoud Almokadem
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