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 lude <lu...@googlemail.com> on 2006/09/04 22:32:35 UTC

QueryParser returns all documents

Hello,

a simple, stupid question to the friendly mailinglist:

How do you have to define the query-string to get all documents of an index
be returned by using the QueryParser?
In theory a query like 'NOT word_not_in_index' should find and return all
documents. In practice this doesn't work (no documents are found).

Greetings
lude

Re: QueryParser returns all documents

Posted by Erick Erickson <er...@gmail.com>.
Also, as I remember, there's explicitly no support for a query consisting
just of "not x"

On 9/4/06, lude <lu...@googlemail.com> wrote:
>
> Hello,
>
> a simple, stupid question to the friendly mailinglist:
>
> How do you have to define the query-string to get all documents of an
> index
> be returned by using the QueryParser?
> In theory a query like 'NOT word_not_in_index' should find and return all
> documents. In practice this doesn't work (no documents are found).
>
> Greetings
> lude
>
>

Re: QueryParser returns all documents

Posted by Laurent Hoss <l....@netbreeze.ch>.
Why not add a single Field to each Document, like

|d.add(*new *Field("doctype","document", Field.Store.YES, Field.Index.TOKENIZED));|

Then searching for "doctype:document" returns all documents

-Laurent

lude wrote:
>> Why would you want to do this?
>
> This is a 'feature-request' of our searchengine.
> The user should have the possibilty to query for all(!) documents.
> This would allow him to see all available document listet.
>
> Is there a simple way to define a query that returns all documents of an
> index?
>
> Thanks lude
>
> On 9/4/06, karl wettin <ka...@gmail.com> wrote:
>>
>> On Mon, 2006-09-04 at 22:32 +0200, lude wrote:
>>
>> > How do you have to define the query-string to get all documents of an
>> index
>> > be returned by using the QueryParser?
>> > In theory a query like 'NOT word_not_in_index' should find and return
>> all
>> > documents. In practice this doesn't work (no documents are found).
>>
>> Why would you want to do this?
>>
>> Use IndexReader methods to iterate all documents.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>


-- 
Mit freundlichen GrĂ¼ssen


Laurent Hoss                                   
NETBREEZE GmbH
Ringstrasse 12
CH-8600 Duebendorf
Switzerland

Tel.  +41 1 824 32 75

www.netbreeze.ch                     



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


Re: QueryParser returns all documents

Posted by Ronnie Kolehmainen <ro...@ub.uu.se>.
You could define your own query syntax (for example an empty string) for 
a query matching all docs, examine the query string before passing it to 
QueryParser, and instead create a MatchAllDocsQuery when a you have a match.

http://lucene.apache.org/java/docs/api/org/apache/lucene/search/MatchAllDocsQuery.html


lude wrote:
>> Why would you want to do this?
> 
> 
> This is a 'feature-request' of our searchengine.
> The user should have the possibilty to query for all(!) documents.
> This would allow him to see all available document listet.
> 
> Is there a simple way to define a query that returns all documents of an
> index?
> 
> Thanks lude
> 
> On 9/4/06, karl wettin <ka...@gmail.com> wrote:
> 
>>
>> On Mon, 2006-09-04 at 22:32 +0200, lude wrote:
>>
>> > How do you have to define the query-string to get all documents of an
>> index
>> > be returned by using the QueryParser?
>> > In theory a query like 'NOT word_not_in_index' should find and return
>> all
>> > documents. In practice this doesn't work (no documents are found).
>>
>> Why would you want to do this?
>>
>> Use IndexReader methods to iterate all documents.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
> 

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


Re: QueryParser returns all documents

Posted by lude <lu...@googlemail.com>.
> Why would you want to do this?

This is a 'feature-request' of our searchengine.
The user should have the possibilty to query for all(!) documents.
This would allow him to see all available document listet.

Is there a simple way to define a query that returns all documents of an
index?

Thanks lude

On 9/4/06, karl wettin <ka...@gmail.com> wrote:
>
> On Mon, 2006-09-04 at 22:32 +0200, lude wrote:
>
> > How do you have to define the query-string to get all documents of an
> index
> > be returned by using the QueryParser?
> > In theory a query like 'NOT word_not_in_index' should find and return
> all
> > documents. In practice this doesn't work (no documents are found).
>
> Why would you want to do this?
>
> Use IndexReader methods to iterate all documents.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: QueryParser returns all documents

Posted by karl wettin <ka...@gmail.com>.
On Mon, 2006-09-04 at 22:32 +0200, lude wrote:

> How do you have to define the query-string to get all documents of an index
> be returned by using the QueryParser?
> In theory a query like 'NOT word_not_in_index' should find and return all
> documents. In practice this doesn't work (no documents are found).

Why would you want to do this?

Use IndexReader methods to iterate all documents.


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