You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sushan Rungta <sr...@clickindia.com> on 2009/07/28 16:49:16 UTC

Re: query in solr lucene

I am extremely sorry for responding late as I was ill from past few days.

My problem is explained below with an example:

I am having three documents with following list:

1. Hello how are you
2. Hello how are you sushan
3. Hello how are you sushan. I am fine.

When I search for a query "Hello how are you sushan", I should only 
get document 2 in my result.

I hope this will give you all a better insight in my problem.

regards,

Sushan Rungta


At 05:24 PM 6/30/2009, Erick Erickson wrote:
>I'm having a hard time understanding what you're reallyafter. What does 80%
>exact match mean? Perhaps
>a couple of examples would help us help you.
>
>Best
>Erick
>
>On Tue, Jun 30, 2009 at 7:36 AM, Sushan Rungta <sr...@clickindia.com> wrote:
>
> > Please assist me in making a query in lucene whereby I shall see the
> > result with:
> >
> > 1. 100% exact match
> > 2. 80% match
> > 3. 60% match.
> >
> > My query string will have minimum number of 100 characters and it may go
> > up by 10000 characters.
> >
> > regards,
> >
> > Sushan Rungta
> > Mob: +91-9312098968
> >
> >



Re: query in solr lucene

Posted by Avlesh Singh <av...@gmail.com>.
What field type are you using? What kind of filters have you applied on the
field?
The easiest way to make it work it to use a "string" field.

Cheers
Avlesh

On Fri, Jul 31, 2009 at 11:09 AM, Sushan Rungta <sr...@clickindia.com> wrote:

> I tried this but this didn't worked...
>
> Regards,
> Sushan
>
> At 12:37 AM 7/30/2009, Avlesh Singh wrote:
>
>> You may index your data using a delimiter, like $my-field-content$. While
>> searching, perform a phrase query with the leading and trailing "$"
>> appended
>> to the query string.
>>
>> Cheers
>> Avlesh
>>
>> On Wed, Jul 29, 2009 at 12:04 PM, Sushan Rungta <sr...@clickindia.com>
>> wrote:
>>
>> > I tried using AND, but it even provided me doc 3 which was not required.
>> >
>> > Hence my problem still persists...
>> >
>> > regards,
>> > Sushan
>> >
>> >
>> > At 06:59 AM 7/29/2009, Avlesh Singh wrote:
>> >
>> >> >
>> >> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as
>> I
>> >> read
>> >> > it.
>> >> >
>> >> Sorry, my bad. I did not read properly before replying.
>> >>
>> >> Cheers
>> >> Avlesh
>> >>
>> >> On Wed, Jul 29, 2009 at 3:23 AM, Erick Erickson <
>> erickerickson@gmail.com
>> >> >wrote:
>> >>
>> >> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as
>> I
>> >> read
>> >> > it.
>> >> >
>> >> > You might have some joy with KeywordAnalyzer, which does
>> >> > not break the incoming stream up into tokens. You have to be
>> >> > careful, though, because it also won't fold the case, so 'Hello'
>> >> > would not match 'hello'.
>> >> >
>> >> > Best
>> >> > Erick
>> >> >
>> >> > On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com>
>> >> wrote:
>> >> >
>> >> > > You should perform a PhraseQuery on the required field.
>> >> > > Meaning, http://your-solr-host:port:
>> >> > > /your-core-path/select?q=fieldName:"Hello
>> >> > > how are you sushan" would work for you.
>> >> > >
>> >> > > Cheers
>> >> > > Avlesh
>> >> > >
>> >> > > 2009/7/28 Gérard Dupont <ge...@gmail.com>
>> >> > >
>> >> > > > Hi Sushan,
>> >> > > >
>> >> > > > I'm not an expert of Solr, just beginner, but it appears to me
>> that
>> >> you
>> >> > > >  may
>> >> > > > have default 'OR' combinaison fo keywords so that will explain
>> this
>> >> > > > behavior. Try to modify the configuration for an 'AND'
>> combinaison.
>> >> > > >
>> >> > > > cheers
>> >> > > >
>> >> > > > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com>
>> >> > wrote:
>> >> > > >
>> >> > > > > I am extremely sorry for responding late as I was ill from past
>> >> few
>> >> > > days.
>> >> > > > >
>> >> > > > > My problem is explained below with an example:
>> >> > > > >
>> >> > > > > I am having three documents with following list:
>> >> > > > >
>> >> > > > > 1. Hello how are you
>> >> > > > > 2. Hello how are you sushan
>> >> > > > > 3. Hello how are you sushan. I am fine.
>> >> > > > >
>> >> > > > > When I search for a query "Hello how are you sushan", I should
>> >> only
>> >> > get
>> >> > > > > document 2 in my result.
>> >> > > > >
>> >> > > > > I hope this will give you all a better insight in my problem.
>> >> > > > >
>> >> > > > > regards,
>> >> > > > >
>> >> > > > > Sushan Rungta
>> >> > > > >
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > > --
>> >> > > > Gérard Dupont
>> >> > > > Information Processing Control and Cognition (IPCC) - EADS DS
>> >> > > > http://weblab-project.org
>> >> > > >
>> >> > > > Document & Learning team - LITIS Laboratory
>> >> > > >
>> >> > >
>> >> >
>> >>
>> >
>> >
>> >
>>
>
>
>

Re: query in solr lucene

Posted by Sushan Rungta <sr...@clickindia.com>.
I tried this but this didn't worked...

Regards,
Sushan

At 12:37 AM 7/30/2009, Avlesh Singh wrote:
>You may index your data using a delimiter, like $my-field-content$. While
>searching, perform a phrase query with the leading and trailing "$" appended
>to the query string.
>
>Cheers
>Avlesh
>
>On Wed, Jul 29, 2009 at 12:04 PM, Sushan Rungta <sr...@clickindia.com> wrote:
>
> > I tried using AND, but it even provided me doc 3 which was not required.
> >
> > Hence my problem still persists...
> >
> > regards,
> > Sushan
> >
> >
> > At 06:59 AM 7/29/2009, Avlesh Singh wrote:
> >
> >> >
> >> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I
> >> read
> >> > it.
> >> >
> >> Sorry, my bad. I did not read properly before replying.
> >>
> >> Cheers
> >> Avlesh
> >>
> >> On Wed, Jul 29, 2009 at 3:23 AM, Erick Erickson <erickerickson@gmail.com
> >> >wrote:
> >>
> >> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I
> >> read
> >> > it.
> >> >
> >> > You might have some joy with KeywordAnalyzer, which does
> >> > not break the incoming stream up into tokens. You have to be
> >> > careful, though, because it also won't fold the case, so 'Hello'
> >> > would not match 'hello'.
> >> >
> >> > Best
> >> > Erick
> >> >
> >> > On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com>
> >> wrote:
> >> >
> >> > > You should perform a PhraseQuery on the required field.
> >> > > Meaning, http://your-solr-host:port:
> >> > > /your-core-path/select?q=fieldName:"Hello
> >> > > how are you sushan" would work for you.
> >> > >
> >> > > Cheers
> >> > > Avlesh
> >> > >
> >> > > 2009/7/28 Gérard Dupont <ge...@gmail.com>
> >> > >
> >> > > > Hi Sushan,
> >> > > >
> >> > > > I'm not an expert of Solr, just beginner, but it appears to me that
> >> you
> >> > > >  may
> >> > > > have default 'OR' combinaison fo keywords so that will explain this
> >> > > > behavior. Try to modify the configuration for an 'AND' combinaison.
> >> > > >
> >> > > > cheers
> >> > > >
> >> > > > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com>
> >> > wrote:
> >> > > >
> >> > > > > I am extremely sorry for responding late as I was ill from past
> >> few
> >> > > days.
> >> > > > >
> >> > > > > My problem is explained below with an example:
> >> > > > >
> >> > > > > I am having three documents with following list:
> >> > > > >
> >> > > > > 1. Hello how are you
> >> > > > > 2. Hello how are you sushan
> >> > > > > 3. Hello how are you sushan. I am fine.
> >> > > > >
> >> > > > > When I search for a query "Hello how are you sushan", I should
> >> only
> >> > get
> >> > > > > document 2 in my result.
> >> > > > >
> >> > > > > I hope this will give you all a better insight in my problem.
> >> > > > >
> >> > > > > regards,
> >> > > > >
> >> > > > > Sushan Rungta
> >> > > > >
> >> > > >
> >> > > >
> >> > > >
> >> > > > --
> >> > > > Gérard Dupont
> >> > > > Information Processing Control and Cognition (IPCC) - EADS DS
> >> > > > http://weblab-project.org
> >> > > >
> >> > > > Document & Learning team - LITIS Laboratory
> >> > > >
> >> > >
> >> >
> >>
> >
> >
> >



Re: query in solr lucene

Posted by Avlesh Singh <av...@gmail.com>.
You may index your data using a delimiter, like $my-field-content$. While
searching, perform a phrase query with the leading and trailing "$" appended
to the query string.

Cheers
Avlesh

On Wed, Jul 29, 2009 at 12:04 PM, Sushan Rungta <sr...@clickindia.com> wrote:

> I tried using AND, but it even provided me doc 3 which was not required.
>
> Hence my problem still persists...
>
> regards,
> Sushan
>
>
> At 06:59 AM 7/29/2009, Avlesh Singh wrote:
>
>> >
>> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I
>> read
>> > it.
>> >
>> Sorry, my bad. I did not read properly before replying.
>>
>> Cheers
>> Avlesh
>>
>> On Wed, Jul 29, 2009 at 3:23 AM, Erick Erickson <erickerickson@gmail.com
>> >wrote:
>>
>> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I
>> read
>> > it.
>> >
>> > You might have some joy with KeywordAnalyzer, which does
>> > not break the incoming stream up into tokens. You have to be
>> > careful, though, because it also won't fold the case, so 'Hello'
>> > would not match 'hello'.
>> >
>> > Best
>> > Erick
>> >
>> > On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com>
>> wrote:
>> >
>> > > You should perform a PhraseQuery on the required field.
>> > > Meaning, http://your-solr-host:port:
>> > > /your-core-path/select?q=fieldName:"Hello
>> > > how are you sushan" would work for you.
>> > >
>> > > Cheers
>> > > Avlesh
>> > >
>> > > 2009/7/28 Gérard Dupont <ge...@gmail.com>
>> > >
>> > > > Hi Sushan,
>> > > >
>> > > > I'm not an expert of Solr, just beginner, but it appears to me that
>> you
>> > > >  may
>> > > > have default 'OR' combinaison fo keywords so that will explain this
>> > > > behavior. Try to modify the configuration for an 'AND' combinaison.
>> > > >
>> > > > cheers
>> > > >
>> > > > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com>
>> > wrote:
>> > > >
>> > > > > I am extremely sorry for responding late as I was ill from past
>> few
>> > > days.
>> > > > >
>> > > > > My problem is explained below with an example:
>> > > > >
>> > > > > I am having three documents with following list:
>> > > > >
>> > > > > 1. Hello how are you
>> > > > > 2. Hello how are you sushan
>> > > > > 3. Hello how are you sushan. I am fine.
>> > > > >
>> > > > > When I search for a query "Hello how are you sushan", I should
>> only
>> > get
>> > > > > document 2 in my result.
>> > > > >
>> > > > > I hope this will give you all a better insight in my problem.
>> > > > >
>> > > > > regards,
>> > > > >
>> > > > > Sushan Rungta
>> > > > >
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > Gérard Dupont
>> > > > Information Processing Control and Cognition (IPCC) - EADS DS
>> > > > http://weblab-project.org
>> > > >
>> > > > Document & Learning team - LITIS Laboratory
>> > > >
>> > >
>> >
>>
>
>
>

Re: query in solr lucene

Posted by Sushan Rungta <sr...@clickindia.com>.
I tried using AND, but it even provided me doc 3 which was not required.

Hence my problem still persists...

regards,
Sushan

At 06:59 AM 7/29/2009, Avlesh Singh wrote:
> >
> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I read
> > it.
> >
>Sorry, my bad. I did not read properly before replying.
>
>Cheers
>Avlesh
>
>On Wed, Jul 29, 2009 at 3:23 AM, Erick Erickson 
><er...@gmail.com>wrote:
>
> > No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I read
> > it.
> >
> > You might have some joy with KeywordAnalyzer, which does
> > not break the incoming stream up into tokens. You have to be
> > careful, though, because it also won't fold the case, so 'Hello'
> > would not match 'hello'.
> >
> > Best
> > Erick
> >
> > On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com> wrote:
> >
> > > You should perform a PhraseQuery on the required field.
> > > Meaning, http://your-solr-host:port:
> > > /your-core-path/select?q=fieldName:"Hello
> > > how are you sushan" would work for you.
> > >
> > > Cheers
> > > Avlesh
> > >
> > > 2009/7/28 Gérard Dupont <ge...@gmail.com>
> > >
> > > > Hi Sushan,
> > > >
> > > > I'm not an expert of Solr, just beginner, but it appears to me that you
> > > >  may
> > > > have default 'OR' combinaison fo keywords so that will explain this
> > > > behavior. Try to modify the configuration for an 'AND' combinaison.
> > > >
> > > > cheers
> > > >
> > > > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com>
> > wrote:
> > > >
> > > > > I am extremely sorry for responding late as I was ill from past few
> > > days.
> > > > >
> > > > > My problem is explained below with an example:
> > > > >
> > > > > I am having three documents with following list:
> > > > >
> > > > > 1. Hello how are you
> > > > > 2. Hello how are you sushan
> > > > > 3. Hello how are you sushan. I am fine.
> > > > >
> > > > > When I search for a query "Hello how are you sushan", I should only
> > get
> > > > > document 2 in my result.
> > > > >
> > > > > I hope this will give you all a better insight in my problem.
> > > > >
> > > > > regards,
> > > > >
> > > > > Sushan Rungta
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Gérard Dupont
> > > > Information Processing Control and Cognition (IPCC) - EADS DS
> > > > http://weblab-project.org
> > > >
> > > > Document & Learning team - LITIS Laboratory
> > > >
> > >
> >



Re: query in solr lucene

Posted by Avlesh Singh <av...@gmail.com>.
>
> No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I read
> it.
>
Sorry, my bad. I did not read properly before replying.

Cheers
Avlesh

On Wed, Jul 29, 2009 at 3:23 AM, Erick Erickson <er...@gmail.com>wrote:

> No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I read
> it.
>
> You might have some joy with KeywordAnalyzer, which does
> not break the incoming stream up into tokens. You have to be
> careful, though, because it also won't fold the case, so 'Hello'
> would not match 'hello'.
>
> Best
> Erick
>
> On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com> wrote:
>
> > You should perform a PhraseQuery on the required field.
> > Meaning, http://your-solr-host:port:
> > /your-core-path/select?q=fieldName:"Hello
> > how are you sushan" would work for you.
> >
> > Cheers
> > Avlesh
> >
> > 2009/7/28 Gérard Dupont <ge...@gmail.com>
> >
> > > Hi Sushan,
> > >
> > > I'm not an expert of Solr, just beginner, but it appears to me that you
> > >  may
> > > have default 'OR' combinaison fo keywords so that will explain this
> > > behavior. Try to modify the configuration for an 'AND' combinaison.
> > >
> > > cheers
> > >
> > > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com>
> wrote:
> > >
> > > > I am extremely sorry for responding late as I was ill from past few
> > days.
> > > >
> > > > My problem is explained below with an example:
> > > >
> > > > I am having three documents with following list:
> > > >
> > > > 1. Hello how are you
> > > > 2. Hello how are you sushan
> > > > 3. Hello how are you sushan. I am fine.
> > > >
> > > > When I search for a query "Hello how are you sushan", I should only
> get
> > > > document 2 in my result.
> > > >
> > > > I hope this will give you all a better insight in my problem.
> > > >
> > > > regards,
> > > >
> > > > Sushan Rungta
> > > >
> > >
> > >
> > >
> > > --
> > > Gérard Dupont
> > > Information Processing Control and Cognition (IPCC) - EADS DS
> > > http://weblab-project.org
> > >
> > > Document & Learning team - LITIS Laboratory
> > >
> >
>

Re: query in solr lucene

Posted by Erick Erickson <er...@gmail.com>.
No, phrase query would match docs 2 and 3. Sushan only wantsdoc 2 as I read
it.

You might have some joy with KeywordAnalyzer, which does
not break the incoming stream up into tokens. You have to be
careful, though, because it also won't fold the case, so 'Hello'
would not match 'hello'.

Best
Erick

On Tue, Jul 28, 2009 at 11:11 AM, Avlesh Singh <av...@gmail.com> wrote:

> You should perform a PhraseQuery on the required field.
> Meaning, http://your-solr-host:port:
> /your-core-path/select?q=fieldName:"Hello
> how are you sushan" would work for you.
>
> Cheers
> Avlesh
>
> 2009/7/28 Gérard Dupont <ge...@gmail.com>
>
> > Hi Sushan,
> >
> > I'm not an expert of Solr, just beginner, but it appears to me that you
> >  may
> > have default 'OR' combinaison fo keywords so that will explain this
> > behavior. Try to modify the configuration for an 'AND' combinaison.
> >
> > cheers
> >
> > On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com> wrote:
> >
> > > I am extremely sorry for responding late as I was ill from past few
> days.
> > >
> > > My problem is explained below with an example:
> > >
> > > I am having three documents with following list:
> > >
> > > 1. Hello how are you
> > > 2. Hello how are you sushan
> > > 3. Hello how are you sushan. I am fine.
> > >
> > > When I search for a query "Hello how are you sushan", I should only get
> > > document 2 in my result.
> > >
> > > I hope this will give you all a better insight in my problem.
> > >
> > > regards,
> > >
> > > Sushan Rungta
> > >
> >
> >
> >
> > --
> > Gérard Dupont
> > Information Processing Control and Cognition (IPCC) - EADS DS
> > http://weblab-project.org
> >
> > Document & Learning team - LITIS Laboratory
> >
>

Re: query in solr lucene

Posted by Avlesh Singh <av...@gmail.com>.
You should perform a PhraseQuery on the required field.
Meaning, http://your-solr-host:port:/your-core-path/select?q=fieldName:"Hello
how are you sushan" would work for you.

Cheers
Avlesh

2009/7/28 Gérard Dupont <ge...@gmail.com>

> Hi Sushan,
>
> I'm not an expert of Solr, just beginner, but it appears to me that you
>  may
> have default 'OR' combinaison fo keywords so that will explain this
> behavior. Try to modify the configuration for an 'AND' combinaison.
>
> cheers
>
> On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com> wrote:
>
> > I am extremely sorry for responding late as I was ill from past few days.
> >
> > My problem is explained below with an example:
> >
> > I am having three documents with following list:
> >
> > 1. Hello how are you
> > 2. Hello how are you sushan
> > 3. Hello how are you sushan. I am fine.
> >
> > When I search for a query "Hello how are you sushan", I should only get
> > document 2 in my result.
> >
> > I hope this will give you all a better insight in my problem.
> >
> > regards,
> >
> > Sushan Rungta
> >
>
>
>
> --
> Gérard Dupont
> Information Processing Control and Cognition (IPCC) - EADS DS
> http://weblab-project.org
>
> Document & Learning team - LITIS Laboratory
>

Re: query in solr lucene

Posted by Gérard Dupont <ge...@gmail.com>.
Hi Sushan,

I'm not an expert of Solr, just beginner, but it appears to me that you  may
have default 'OR' combinaison fo keywords so that will explain this
behavior. Try to modify the configuration for an 'AND' combinaison.

cheers

On Tue, Jul 28, 2009 at 16:49, Sushan Rungta <sr...@clickindia.com> wrote:

> I am extremely sorry for responding late as I was ill from past few days.
>
> My problem is explained below with an example:
>
> I am having three documents with following list:
>
> 1. Hello how are you
> 2. Hello how are you sushan
> 3. Hello how are you sushan. I am fine.
>
> When I search for a query "Hello how are you sushan", I should only get
> document 2 in my result.
>
> I hope this will give you all a better insight in my problem.
>
> regards,
>
> Sushan Rungta
>



-- 
Gérard Dupont
Information Processing Control and Cognition (IPCC) - EADS DS
http://weblab-project.org

Document & Learning team - LITIS Laboratory