You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Rakesh Shete <ra...@hotmail.com> on 2008/01/02 20:28:35 UTC
Using multiple filters
Hi all,
I have a query related to using filters.
My search would something like this:
title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO 20071231]
which retrieves all books with title "java" that have a price between 100 & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
Can I use multiple filters in such a case (RangeFilter for pricerange & QueryWrapperFilter for daterange)?
How do I specify multiple filters to the IndexSearcher (the API does not support it as of now)?
Note: I am even open to using RangeQuery as long as it does not hamper performance of search. My reading of the mailing list suggests me that using filters would be better (RangeFilter) than query (RangeQuery): http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
--Regards,
Rakesh S
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=221
Re: Stemming and highlighting
Posted by Daniel Naber <lu...@danielnaber.de>.
On Freitag, 4. Januar 2008, Marjan Celikik wrote:
> I am a new Lucene user and I would like to know the following. How does
> Lucene bring together fuzzy queries and highlighting?
You need to call rewrite() on the fuzzy query. This will expand the fuzzy
query to all similar terms (e.g. belies~ -> belief OR believe).
Highlighting then doesn't work different than for non-fuzzy queries.
Regards
Daniel
--
http://www.danielnaber.de
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Stemming and highlighting
Posted by markharw00d <ma...@yahoo.co.uk>.
>
> Let's say for the query algorithm, the word algorith is also a match,
> how do the highlighter know that it should also highlight
> occurrences of the word algorith? (I am not sure it does this anyway)
The highlighter knows to highlight stemmed words because both the query
terms and the document content are fed through (hopefully) the same
analyzer so that "algorithmic", "algorithm", "algorithms" etc become
stemmed to the same root form in both query and doc content. The tokens
produced by analyzers include the byte offsets of the *original* full
word, not just the stemmed form, so the highlighter knows the full
extent of what to highlight in text.
Cheers
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Stemming and highlighting
Posted by Marjan Celikik <ce...@gmail.com>.
Dear all,
I am a new Lucene user and I would like to know the following. How does
Lucene bring together fuzzy queries and highlighting?
Let's say for the query algorithm, the word algorith is also a match,
how do the highlighter know that it should also highlight
occurrences of the word algorith? (I am not sure it does this anyway)
Thank you!
Marjan.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Using multiple filters
Posted by Rakesh Shete <ra...@hotmail.com>.
Hey thanks Eric.
This should help me.
--Regards
Rakesh S
> Date: Thu, 3 Jan 2008 13:31:32 -0500
> From: erickerickson@gmail.com
> To: java-user@lucene.apache.org
> Subject: Re: Using multiple filters
>
> You have to put lucene-misc<version>.jar (which you should have in your
> lucene<version>/contrib/misc directory
>
> Erick
>
> On Jan 3, 2008 10:56 AM, Rakesh Shete <ra...@hotmail.com> wrote:
>
> >
> > Here is the link I found on googgling:
> >
> >
> > http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/misc/ChainedFilter.html
> >
> >
> > > From: rakesh_shete@hotmail.com
> > > To: java-user@lucene.apache.org
> > > Subject: RE: Using multiple filters
> > > Date: Thu, 3 Jan 2008 21:24:35 +0530
> > >
> > >
> > > Hi Eric, Mark,
> > >
> > > I am using Lucene 2.2.0 and I dont see anything like ChainedFilter or
> > BooleanFilter. Is that not supported now?
> > >
> > > Googling on it I found that the ChainedFilter is in some *misc* package.
> > So I believe it has either been dropped or not shipped with the official
> > version.
> > >
> > > -- Regards,
> > > Rakesh Shete
> > >
> > > > Date: Wed, 2 Jan 2008 20:50:28 +0000
> > > > From: markharw00d@yahoo.co.uk
> > > > To: java-user@lucene.apache.org
> > > > Subject: Re: Using multiple filters
> > > >
> > > > BooleanFilter in contrib is similar to ChainedFilter but just
> > expresses
> > > > the boolean logic using the same vocabulary as BooleanQuery
> > ("should"s,
> > > > "must"s and "not"s).
> > > >
> > > > Cheers
> > > > Mark
> > > >
> > > > Erick Erickson wrote:
> > > > > I think you can just throw them all together in a
> > > > > ChainedFilter and use the ChainedFilter wherever
> > > > > your calls want a Filter.
> > > > >
> > > > > But I haven't tried it <G>...
> > > > >
> > > > > Erick
> > > > >
> > > > > On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com>
> > wrote:
> > > > >
> > > > >
> > > > >> Hi all,
> > > > >>
> > > > >> I have a query related to using filters.
> > > > >>
> > > > >> My search would something like this:
> > > > >>
> > > > >> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO
> > 20071231]
> > > > >>
> > > > >> which retrieves all books with title "java" that have a price
> > between 100
> > > > >> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
> > > > >>
> > > > >> Can I use multiple filters in such a case (RangeFilter for
> > pricerange &
> > > > >> QueryWrapperFilter for daterange)?
> > > > >>
> > > > >> How do I specify multiple filters to the IndexSearcher (the API
> > does not
> > > > >> support it as of now)?
> > > > >>
> > > > >> Note: I am even open to using RangeQuery as long as it does not
> > hamper
> > > > >> performance of search. My reading of the mailing list suggests me
> > that using
> > > > >> filters would be better (RangeFilter) than query (RangeQuery):
> > > > >>
> > http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
> > > > >>
> > > > >>
> > > > >>
> > > > >> --Regards,
> > > > >> Rakesh S
> > > > >>
> > > > >>
> > > > >>
> > > > >> _________________________________________________________________
> > > > >> Post free property ads on Yello Classifieds now! www.yello.in
> > > > >> http://ss1.richmedia.in/recurl.asp?pid=221
> > > > >>
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > > >
> > >
> > > _________________________________________________________________
> > > Post free property ads on Yello Classifieds now! www.yello.in
> > > http://ss1.richmedia.in/recurl.asp?pid=221
> >
> > _________________________________________________________________
> > Post free property ads on Yello Classifieds now! www.yello.in
> > http://ss1.richmedia.in/recurl.asp?pid=219
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=221
Re: Using multiple filters
Posted by Erick Erickson <er...@gmail.com>.
You have to put lucene-misc<version>.jar (which you should have in your
lucene<version>/contrib/misc directory
Erick
On Jan 3, 2008 10:56 AM, Rakesh Shete <ra...@hotmail.com> wrote:
>
> Here is the link I found on googgling:
>
>
> http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/misc/ChainedFilter.html
>
>
> > From: rakesh_shete@hotmail.com
> > To: java-user@lucene.apache.org
> > Subject: RE: Using multiple filters
> > Date: Thu, 3 Jan 2008 21:24:35 +0530
> >
> >
> > Hi Eric, Mark,
> >
> > I am using Lucene 2.2.0 and I dont see anything like ChainedFilter or
> BooleanFilter. Is that not supported now?
> >
> > Googling on it I found that the ChainedFilter is in some *misc* package.
> So I believe it has either been dropped or not shipped with the official
> version.
> >
> > -- Regards,
> > Rakesh Shete
> >
> > > Date: Wed, 2 Jan 2008 20:50:28 +0000
> > > From: markharw00d@yahoo.co.uk
> > > To: java-user@lucene.apache.org
> > > Subject: Re: Using multiple filters
> > >
> > > BooleanFilter in contrib is similar to ChainedFilter but just
> expresses
> > > the boolean logic using the same vocabulary as BooleanQuery
> ("should"s,
> > > "must"s and "not"s).
> > >
> > > Cheers
> > > Mark
> > >
> > > Erick Erickson wrote:
> > > > I think you can just throw them all together in a
> > > > ChainedFilter and use the ChainedFilter wherever
> > > > your calls want a Filter.
> > > >
> > > > But I haven't tried it <G>...
> > > >
> > > > Erick
> > > >
> > > > On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com>
> wrote:
> > > >
> > > >
> > > >> Hi all,
> > > >>
> > > >> I have a query related to using filters.
> > > >>
> > > >> My search would something like this:
> > > >>
> > > >> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO
> 20071231]
> > > >>
> > > >> which retrieves all books with title "java" that have a price
> between 100
> > > >> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
> > > >>
> > > >> Can I use multiple filters in such a case (RangeFilter for
> pricerange &
> > > >> QueryWrapperFilter for daterange)?
> > > >>
> > > >> How do I specify multiple filters to the IndexSearcher (the API
> does not
> > > >> support it as of now)?
> > > >>
> > > >> Note: I am even open to using RangeQuery as long as it does not
> hamper
> > > >> performance of search. My reading of the mailing list suggests me
> that using
> > > >> filters would be better (RangeFilter) than query (RangeQuery):
> > > >>
> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
> > > >>
> > > >>
> > > >>
> > > >> --Regards,
> > > >> Rakesh S
> > > >>
> > > >>
> > > >>
> > > >> _________________________________________________________________
> > > >> Post free property ads on Yello Classifieds now! www.yello.in
> > > >> http://ss1.richmedia.in/recurl.asp?pid=221
> > > >>
> > > >
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> >
> > _________________________________________________________________
> > Post free property ads on Yello Classifieds now! www.yello.in
> > http://ss1.richmedia.in/recurl.asp?pid=221
>
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=219
RE: Using multiple filters
Posted by Rakesh Shete <ra...@hotmail.com>.
Here is the link I found on googgling:
http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/misc/ChainedFilter.html
> From: rakesh_shete@hotmail.com
> To: java-user@lucene.apache.org
> Subject: RE: Using multiple filters
> Date: Thu, 3 Jan 2008 21:24:35 +0530
>
>
> Hi Eric, Mark,
>
> I am using Lucene 2.2.0 and I dont see anything like ChainedFilter or BooleanFilter. Is that not supported now?
>
> Googling on it I found that the ChainedFilter is in some *misc* package. So I believe it has either been dropped or not shipped with the official version.
>
> -- Regards,
> Rakesh Shete
>
> > Date: Wed, 2 Jan 2008 20:50:28 +0000
> > From: markharw00d@yahoo.co.uk
> > To: java-user@lucene.apache.org
> > Subject: Re: Using multiple filters
> >
> > BooleanFilter in contrib is similar to ChainedFilter but just expresses
> > the boolean logic using the same vocabulary as BooleanQuery ("should"s,
> > "must"s and "not"s).
> >
> > Cheers
> > Mark
> >
> > Erick Erickson wrote:
> > > I think you can just throw them all together in a
> > > ChainedFilter and use the ChainedFilter wherever
> > > your calls want a Filter.
> > >
> > > But I haven't tried it <G>...
> > >
> > > Erick
> > >
> > > On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com> wrote:
> > >
> > >
> > >> Hi all,
> > >>
> > >> I have a query related to using filters.
> > >>
> > >> My search would something like this:
> > >>
> > >> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO 20071231]
> > >>
> > >> which retrieves all books with title "java" that have a price between 100
> > >> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
> > >>
> > >> Can I use multiple filters in such a case (RangeFilter for pricerange &
> > >> QueryWrapperFilter for daterange)?
> > >>
> > >> How do I specify multiple filters to the IndexSearcher (the API does not
> > >> support it as of now)?
> > >>
> > >> Note: I am even open to using RangeQuery as long as it does not hamper
> > >> performance of search. My reading of the mailing list suggests me that using
> > >> filters would be better (RangeFilter) than query (RangeQuery):
> > >> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
> > >>
> > >>
> > >>
> > >> --Regards,
> > >> Rakesh S
> > >>
> > >>
> > >>
> > >> _________________________________________________________________
> > >> Post free property ads on Yello Classifieds now! www.yello.in
> > >> http://ss1.richmedia.in/recurl.asp?pid=221
> > >>
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
>
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=221
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=219
RE: Using multiple filters
Posted by Rakesh Shete <ra...@hotmail.com>.
Hi Eric, Mark,
I am using Lucene 2.2.0 and I dont see anything like ChainedFilter or BooleanFilter. Is that not supported now?
Googling on it I found that the ChainedFilter is in some *misc* package. So I believe it has either been dropped or not shipped with the official version.
-- Regards,
Rakesh Shete
> Date: Wed, 2 Jan 2008 20:50:28 +0000
> From: markharw00d@yahoo.co.uk
> To: java-user@lucene.apache.org
> Subject: Re: Using multiple filters
>
> BooleanFilter in contrib is similar to ChainedFilter but just expresses
> the boolean logic using the same vocabulary as BooleanQuery ("should"s,
> "must"s and "not"s).
>
> Cheers
> Mark
>
> Erick Erickson wrote:
> > I think you can just throw them all together in a
> > ChainedFilter and use the ChainedFilter wherever
> > your calls want a Filter.
> >
> > But I haven't tried it <G>...
> >
> > Erick
> >
> > On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com> wrote:
> >
> >
> >> Hi all,
> >>
> >> I have a query related to using filters.
> >>
> >> My search would something like this:
> >>
> >> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO 20071231]
> >>
> >> which retrieves all books with title "java" that have a price between 100
> >> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
> >>
> >> Can I use multiple filters in such a case (RangeFilter for pricerange &
> >> QueryWrapperFilter for daterange)?
> >>
> >> How do I specify multiple filters to the IndexSearcher (the API does not
> >> support it as of now)?
> >>
> >> Note: I am even open to using RangeQuery as long as it does not hamper
> >> performance of search. My reading of the mailing list suggests me that using
> >> filters would be better (RangeFilter) than query (RangeQuery):
> >> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
> >>
> >>
> >>
> >> --Regards,
> >> Rakesh S
> >>
> >>
> >>
> >> _________________________________________________________________
> >> Post free property ads on Yello Classifieds now! www.yello.in
> >> http://ss1.richmedia.in/recurl.asp?pid=221
> >>
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=221
Re: Using multiple filters
Posted by markharw00d <ma...@yahoo.co.uk>.
BooleanFilter in contrib is similar to ChainedFilter but just expresses
the boolean logic using the same vocabulary as BooleanQuery ("should"s,
"must"s and "not"s).
Cheers
Mark
Erick Erickson wrote:
> I think you can just throw them all together in a
> ChainedFilter and use the ChainedFilter wherever
> your calls want a Filter.
>
> But I haven't tried it <G>...
>
> Erick
>
> On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com> wrote:
>
>
>> Hi all,
>>
>> I have a query related to using filters.
>>
>> My search would something like this:
>>
>> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO 20071231]
>>
>> which retrieves all books with title "java" that have a price between 100
>> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
>>
>> Can I use multiple filters in such a case (RangeFilter for pricerange &
>> QueryWrapperFilter for daterange)?
>>
>> How do I specify multiple filters to the IndexSearcher (the API does not
>> support it as of now)?
>>
>> Note: I am even open to using RangeQuery as long as it does not hamper
>> performance of search. My reading of the mailing list suggests me that using
>> filters would be better (RangeFilter) than query (RangeQuery):
>> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
>>
>>
>>
>> --Regards,
>> Rakesh S
>>
>>
>>
>> _________________________________________________________________
>> Post free property ads on Yello Classifieds now! www.yello.in
>> http://ss1.richmedia.in/recurl.asp?pid=221
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Using multiple filters
Posted by Erick Erickson <er...@gmail.com>.
I think you can just throw them all together in a
ChainedFilter and use the ChainedFilter wherever
your calls want a Filter.
But I haven't tried it <G>...
Erick
On Jan 2, 2008 2:28 PM, Rakesh Shete <ra...@hotmail.com> wrote:
>
> Hi all,
>
> I have a query related to using filters.
>
> My search would something like this:
>
> title:java* +pricerange:[00100 TO 01000] +daterange:[20000101 TO 20071231]
>
> which retrieves all books with title "java" that have a price between 100
> & 1000 and a fall between Jan 01,2000 & Dec 31,2007 daterange.
>
> Can I use multiple filters in such a case (RangeFilter for pricerange &
> QueryWrapperFilter for daterange)?
>
> How do I specify multiple filters to the IndexSearcher (the API does not
> support it as of now)?
>
> Note: I am even open to using RangeQuery as long as it does not hamper
> performance of search. My reading of the mailing list suggests me that using
> filters would be better (RangeFilter) than query (RangeQuery):
> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg10687.html
>
>
>
> --Regards,
> Rakesh S
>
>
>
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=221