Mailing List Archive

Re: Within Search
Hello,

I'm sending this to lucene-user list, as that seems more appropriate.
I haven't used Lucene's slop feature, but it looks like both
QueryParser and PhraseQuery have support for slop. I am not sure what
the syntax for it is, but if nothign else you should be able to call
setSlop(int) method on an instance of PhraseQuery.

Oh, it looks like you missed it in the Query Parser Syntax document:
http://jakarta.apache.org/lucene/docs/queryparsersyntax.html

Otis


--- none none <korfut@lycos.com> wrote:
> hi,
> i asked some help about this feature some time ago, but no answer.
> What do i need to do is the WithinPhraseSearch. An example can be:
>
> search for: "car w/10 rent".
>
> This mean, look for documents that contains 'car' and within 10 words
> 'rent'. So, what i think i need is:
>
> 1.Change the QueryParser.jj to reconize the operator "w/xx" as the
> within operator.
>
> 2.The QueryParser should return a PhraseQuery with a "slop" factor
> equals to '10' for the example above. Should also ignore "w/xx" if xx
> is not numeric.
>
> An other question: what should i do if i want the query operator
> (AND,OR,NOT,etc) to be case insensitive? what should i change inside
> the QueryParser.jj ?
>
> PLEASE HELP, because i really don't know how to use the "JavaCC"
> utility.
>
> Thanks,
> bye.
>
>
>
>
> _______________________________________________________
> WIN a first class trip to Hawaii. Live like the King of Rock and
> Roll
> on the big Island. Enter Now!
>
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Within Search [ In reply to ]
thanks, i saw the queryparser documentation and works fine.
now how can i make the query operator like 'AND', 'OR', etc, case insensitive? also how can i change the '~' to 'w/' ?
I really don't know how use JavaCC, but may be for someone is easy,
someone can help me?
thank you.
--

On Mon, 10 Jun 2002 09:01:29
none none wrote:
>hi,
>i asked some help about this feature some time ago, but no answer.
>What do i need to do is the WithinPhraseSearch. An example can be:
>
>search for: "car w/10 rent".
>
>This mean, look for documents that contains 'car' and within 10 words 'rent'. So, what i think i need is:
>
>1.Change the QueryParser.jj to reconize the operator "w/xx" as the within operator.
>
>2.The QueryParser should return a PhraseQuery with a "slop" factor equals to '10' for the example above. Should also ignore "w/xx" if xx is not numeric.
>
>An other question: what should i do if i want the query operator (AND,OR,NOT,etc) to be case insensitive? what should i change inside the QueryParser.jj ?
>
>PLEASE HELP, because i really don't know how to use the "JavaCC" utility.
>
>Thanks,
>bye.
>
>
>
>
>_______________________________________________________
>WIN a first class trip to Hawaii. Live like the King of Rock and Roll
>on the big Island. Enter Now!
>http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>
>--
>To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
>
>


_______________________________________________________
WIN a first class trip to Hawaii. Live like the King of Rock and Roll
on the big Island. Enter Now!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Within Search [ In reply to ]
This is a bit more complicated.

We have had this discussion a while ago about having a NEAR operator. The
queryParser.jj of how to do this in the developer mailling list.

The problem is that the solution is not generic. That is what if the term is
a wildcard or a more complicated sub query (a query in parentheses).

For example
(a AND b) w/ c

This type of query is not supported by the Lucene Slop factor. That's why
it's not support in Lucene as part of the general QueryParser.

If you are willing to live with these limitations, the queryParser.jj with
the NEAR operator should work.

--Peter


On 6/10/02 1:19 PM, "none none" <korfut@lycos.com> wrote:

> thanks, i saw the queryparser documentation and works fine.
> now how can i make the query operator like 'AND', 'OR', etc, case insensitive?
> also how can i change the '~' to 'w/' ?
> I really don't know how use JavaCC, but may be for someone is easy,
> someone can help me?
> thank you.
> --
>
> On Mon, 10 Jun 2002 09:01:29
> none none wrote:
>> hi,
>> i asked some help about this feature some time ago, but no answer.
>> What do i need to do is the WithinPhraseSearch. An example can be:
>>
>> search for: "car w/10 rent".
>>
>> This mean, look for documents that contains 'car' and within 10 words 'rent'.
>> So, what i think i need is:
>>
>> 1.Change the QueryParser.jj to reconize the operator "w/xx" as the within
>> operator.
>>
>> 2.The QueryParser should return a PhraseQuery with a "slop" factor equals to
>> '10' for the example above. Should also ignore "w/xx" if xx is not numeric.
>>
>> An other question: what should i do if i want the query operator
>> (AND,OR,NOT,etc) to be case insensitive? what should i change inside the
>> QueryParser.jj ?
>>
>> PLEASE HELP, because i really don't know how to use the "JavaCC" utility.
>>
>> Thanks,
>> bye.
>>
>>
>>
>>
>> _______________________________________________________
>> WIN a first class trip to Hawaii. Live like the King of Rock and Roll
>> on the big Island. Enter Now!
>> http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>>
>> --
>> To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
>>
>>
>
>
> _______________________________________________________
> WIN a first class trip to Hawaii. Live like the King of Rock and Roll
> on the big Island. Enter Now!
> http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Within Search [ In reply to ]
the developer list sent my question to the user list!
Are you telling me that i can write 'NEAR' instead of '~'?
I have the rc4, do i need to update to rc5?
What about the case insensitive operator? is ther any way to do that?
bye
--

On Mon, 10 Jun 2002 16:02:18
Peter Carlson wrote:
>This is a bit more complicated.
>
>We have had this discussion a while ago about having a NEAR operator. The
>queryParser.jj of how to do this in the developer mailling list.
>
>The problem is that the solution is not generic. That is what if the term is
>a wildcard or a more complicated sub query (a query in parentheses).
>
>For example
>(a AND b) w/ c
>
>This type of query is not supported by the Lucene Slop factor. That's why
>it's not support in Lucene as part of the general QueryParser.
>
>If you are willing to live with these limitations, the queryParser.jj with
>the NEAR operator should work.
>
>--Peter
>
>
>On 6/10/02 1:19 PM, "none none" <korfut@lycos.com> wrote:
>
>> thanks, i saw the queryparser documentation and works fine.
>> now how can i make the query operator like 'AND', 'OR', etc, case insensitive?
>> also how can i change the '~' to 'w/' ?
>> I really don't know how use JavaCC, but may be for someone is easy,
>> someone can help me?
>> thank you.
>> --
>>
>> On Mon, 10 Jun 2002 09:01:29
>> none none wrote:
>>> hi,
>>> i asked some help about this feature some time ago, but no answer.
>>> What do i need to do is the WithinPhraseSearch. An example can be:
>>>
>>> search for: "car w/10 rent".
>>>
>>> This mean, look for documents that contains 'car' and within 10 words 'rent'.
>>> So, what i think i need is:
>>>
>>> 1.Change the QueryParser.jj to reconize the operator "w/xx" as the within
>>> operator.
>>>
>>> 2.The QueryParser should return a PhraseQuery with a "slop" factor equals to
>>> '10' for the example above. Should also ignore "w/xx" if xx is not numeric.
>>>
>>> An other question: what should i do if i want the query operator
>>> (AND,OR,NOT,etc) to be case insensitive? what should i change inside the
>>> QueryParser.jj ?
>>>
>>> PLEASE HELP, because i really don't know how to use the "JavaCC" utility.
>>>
>>> Thanks,
>>> bye.
>>>
>>>
>>>
>>>
>>> _______________________________________________________
>>> WIN a first class trip to Hawaii. Live like the King of Rock and Roll
>>> on the big Island. Enter Now!
>>> http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>>>
>>> --
>>> To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
>>> For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
>>>
>>>
>>
>>
>> _______________________________________________________
>> WIN a first class trip to Hawaii. Live like the King of Rock and Roll
>> on the big Island. Enter Now!
>> http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>>
>> --
>> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>>
>>
>
>
>--
>To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


_______________________________________________________
WIN a first class trip to Hawaii. Live like the King of Rock and Roll
on the big Island. Enter Now!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Within Search [ In reply to ]
It may be easier to have your User Interface convert user-entered 'and'
'or', etc... into the proper 'AND' 'OR' etc... just prior to calling the
query parser.

-Brandon

----- Original Message -----
From: "none none" <korfut@lycos.com>
To: <lucene-user@jakarta.apache.org>
Sent: Monday, June 10, 2002 3:19 PM
Subject: Re: Within Search


> thanks, i saw the queryparser documentation and works fine.
> now how can i make the query operator like 'AND', 'OR', etc, case
insensitive? also how can i change the '~' to 'w/' ?
> I really don't know how use JavaCC, but may be for someone is easy,
> someone can help me?
> thank you.
> --
>
> On Mon, 10 Jun 2002 09:01:29
> none none wrote:
> >hi,
> >i asked some help about this feature some time ago, but no answer.
> >What do i need to do is the WithinPhraseSearch. An example can be:
> >
> >search for: "car w/10 rent".
> >
> >This mean, look for documents that contains 'car' and within 10 words
'rent'. So, what i think i need is:
> >
> >1.Change the QueryParser.jj to reconize the operator "w/xx" as the within
operator.
> >
> >2.The QueryParser should return a PhraseQuery with a "slop" factor equals
to '10' for the example above. Should also ignore "w/xx" if xx is not
numeric.
> >
> >An other question: what should i do if i want the query operator
(AND,OR,NOT,etc) to be case insensitive? what should i change inside the
QueryParser.jj ?
> >
> >PLEASE HELP, because i really don't know how to use the "JavaCC" utility.
> >
> >Thanks,
> >bye.
> >
> >
> >
> >
> >_______________________________________________________
> >WIN a first class trip to Hawaii. Live like the King of Rock and Roll
> >on the big Island. Enter Now!
> >http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
> >
> >--
> >To unsubscribe, e-mail:
<mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
<mailto:lucene-dev-help@jakarta.apache.org>
> >
> >
>
>
> _______________________________________________________
> WIN a first class trip to Hawaii. Live like the King of Rock and Roll
> on the big Island. Enter Now!
> http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>