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 Ryan Moffat <ry...@hotmail.com> on 2003/04/15 16:16:39 UTC

Filtering the entire index

Hi there

I apologise if this is obvious, I have read as much as I can in the FAQ's
and API docs but can not see a solution for my problem.

I would like to be able to search the entire index and use only the Lucene
filters for results.  I had a lot of trouble searching for date and int
ranges using terms and consequently used the ChainableFilter code (thanks to
Kelvin Tan) which works like a charm as long as I include some query.  I can
not see a way of just using * as a query (cant start search with * etc)

Of course the idea of saying search everything in the index just to let the
filters do the work seems a bit daft to me so possibly I'm on the completely
wrong track?

Any help muchos appreciated

Thanks
Ryan Moffat

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


Re: Filtering the entire index

Posted by Morus Walter <mo...@tanto-xipolis.de>.
Hi Ryan,
> 
> I would like to be able to search the entire index and use only the Lucene
> filters for results.  I had a lot of trouble searching for date and int
> ranges using terms and consequently used the ChainableFilter code (thanks to
> Kelvin Tan) which works like a charm as long as I include some query.  I can
> not see a way of just using * as a query (cant start search with * etc)
> 
> Of course the idea of saying search everything in the index just to let the
> filters do the work seems a bit daft to me so possibly I'm on the completely
> wrong track?
> 
What's the use of a query in this scenario?
I mean, if you have a filter describing the documents you want to find,
you can simply loop over the filter and fetch the documents, for which the
bit is set, using a IndexReader.
Ok, it's a few lines of code to write (<= 10 I guess) but I don't see any
advantage from combining this with a query.

Morus

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


Re: Filtering the entire index

Posted by Ryan Moffat <ry...@hotmail.com>.
Simple, easy to do and working.  :-)

Thanks Victor

----- Original Message -----
From: "Victor Hadianto" <vi...@nuix.com.au>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, April 16, 2003 1:19 AM
Subject: Re: Filtering the entire index


> > I would like to be able to search the entire index and use only the
Lucene
>
> You can achieve this by setting a special field in Lucene and set the
value
> for that field for all your document to say "1".
>
> When doing the query you can search for this field and the value "1" which
of
> course will return all documents in your Lucene index. Then the filters
will
> do their work.
>
> > Ryan Moffat
>
> victor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>

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


Re: Filtering the entire index

Posted by Ryan Moffat <ry...@hotmail.com>.
Yes, a custom field would be nice hopefully it will be included some day!

Thanks for the reponse!

----- Original Message -----
From: "Kelvin Tan" <ke...@relevanz.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, April 16, 2003 3:36 AM
Subject: Re: Filtering the entire index


This workaround is documented in the FAQ. However, I which there was a
constant
in Field.java which does the same thing for me.

So if I want to return all documents, I can search like

QueryParser.parse(Field.ALL_DOCS, Field.ALL_DOCS, filter)

But obviously something like this is just sugar...

On Wed, 16 Apr 2003 11:19:34 +1100, Victor Hadianto said:
>>I would like to be able to search the entire index and use only the
>>Lucene
>
>You can achieve this by setting a special field in Lucene and set
>the value
>for that field for all your document to say "1".
>
>When doing the query you can search for this field and the value "1"
>which of
>course will return all documents in your Lucene index. Then the
>filters will
>do their work.
>
>>Ryan Moffat
>
>victor
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org





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



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


Re: Filtering the entire index

Posted by Kelvin Tan <ke...@relevanz.com>.
This workaround is documented in the FAQ. However, I which there was a constant 
in Field.java which does the same thing for me.

So if I want to return all documents, I can search like 

QueryParser.parse(Field.ALL_DOCS, Field.ALL_DOCS, filter)

But obviously something like this is just sugar...

On Wed, 16 Apr 2003 11:19:34 +1100, Victor Hadianto said:
>>I would like to be able to search the entire index and use only the
>>Lucene
>
>You can achieve this by setting a special field in Lucene and set
>the value
>for that field for all your document to say "1".
>
>When doing the query you can search for this field and the value "1"
>which of
>course will return all documents in your Lucene index. Then the
>filters will
>do their work.
>
>>Ryan Moffat
>
>victor
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org





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


Re: Filtering the entire index

Posted by Victor Hadianto <vi...@nuix.com.au>.
> I would like to be able to search the entire index and use only the Lucene

You can achieve this by setting a special field in Lucene and set the value 
for that field for all your document to say "1".

When doing the query you can search for this field and the value "1" which of 
course will return all documents in your Lucene index. Then the filters will 
do their work.

> Ryan Moffat

victor

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