Re: Finding All?

2004-08-16 Thread Patrick Burleson
Thanks very much for all of the replies. I have gone for the "ALL"
field trick. Works very well for me.

Patrick

On Fri, 13 Aug 2004 21:02:49 -0400, Erik Hatcher
<[EMAIL PROTECTED]> wrote:
> 
> On Aug 13, 2004, at 4:01 PM, [EMAIL PROTECTED] wrote:
> > A ranged query that covers the full range does the same thing.
> >
> > Of course it is also inefficient with term generation:  myField[a TO z]
> 
> Note that this won't work if you have more than 1024 matching terms,
> which is a quite likely scenario.  The special "all" field trick is a
> nice option.
> 
> Another suggestion is to simply make a special case for an "all" query
> and use IndexReader to walk the documents in the index directly.
> 
> Erik
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finding All?

2004-08-13 Thread Erik Hatcher
On Aug 13, 2004, at 4:01 PM, [EMAIL PROTECTED] wrote:
A ranged query that covers the full range does the same thing.
Of course it is also inefficient with term generation:  myField[a TO z]
Note that this won't work if you have more than 1024 matching terms, 
which is a quite likely scenario.  The special "all" field trick is a 
nice option.

Another suggestion is to simply make a special case for an "all" query 
and use IndexReader to walk the documents in the index directly.

Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Finding All?

2004-08-13 Thread wallen
A ranged query that covers the full range does the same thing.  

Of course it is also inefficient with term generation:  myField[a TO z]

-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 3:58 PM
To: Lucene Users List
Subject: Re: Finding All?


That is a very interesting idea. I might give that a shot. 

Thanks,
Patrick

On Fri, 13 Aug 2004 15:36:11 -0400, Tate Avery <[EMAIL PROTECTED]>
wrote:
> 
> I had to do this once and I put a field called "all" with a value of
"true" for every document.
> 
> _doc.addField(Field.Keyword("all", "true"));
> 
> Then, if there was an empty query, I would substitute it for the query
"all:true".  And, of course, every doc would match this.
> 
> There might be a MUCH more elegant solution, but this certainly worked for
me and was quite easy to incorporate.  And, it appears to order the
documents by the order in which they were indexed.
> 
> T
> 
> p.s. You can probably do something using IndexReader directly... but the
nice thing about this approach is that you are still just using a simple
query.
> 
> 
> 
> -Original Message-
> From: Patrick Burleson [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 3:25 PM
> To: Lucene Users List
> Subject: Finding All?
> 
> Is there a way for lucene to find all documents? Say if I have a
> search input and someone puts  nothing in I want to go ahead and
> return everything. Passing "*" to QueryParser was not pretty.
> 
> Thanks,
> Patrick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finding All?

2004-08-13 Thread Patrick Burleson
That is a very interesting idea. I might give that a shot. 

Thanks,
Patrick

On Fri, 13 Aug 2004 15:36:11 -0400, Tate Avery <[EMAIL PROTECTED]> wrote:
> 
> I had to do this once and I put a field called "all" with a value of "true" for 
> every document.
> 
> _doc.addField(Field.Keyword("all", "true"));
> 
> Then, if there was an empty query, I would substitute it for the query "all:true".  
> And, of course, every doc would match this.
> 
> There might be a MUCH more elegant solution, but this certainly worked for me and 
> was quite easy to incorporate.  And, it appears to order the documents by the order 
> in which they were indexed.
> 
> T
> 
> p.s. You can probably do something using IndexReader directly... but the nice thing 
> about this approach is that you are still just using a simple query.
> 
> 
> 
> -Original Message-
> From: Patrick Burleson [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 3:25 PM
> To: Lucene Users List
> Subject: Finding All?
> 
> Is there a way for lucene to find all documents? Say if I have a
> search input and someone puts  nothing in I want to go ahead and
> return everything. Passing "*" to QueryParser was not pretty.
> 
> Thanks,
> Patrick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Finding All?

2004-08-13 Thread Tate Avery

I had to do this once and I put a field called "all" with a value of "true" for every 
document.

_doc.addField(Field.Keyword("all", "true"));

Then, if there was an empty query, I would substitute it for the query "all:true".  
And, of course, every doc would match this.

There might be a MUCH more elegant solution, but this certainly worked for me and was 
quite easy to incorporate.  And, it appears to order the documents by the order in 
which they were indexed.

T

p.s. You can probably do something using IndexReader directly... but the nice thing 
about this approach is that you are still just using a simple query.

-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 3:25 PM
To: Lucene Users List
Subject: Finding All?


Is there a way for lucene to find all documents? Say if I have a
search input and someone puts  nothing in I want to go ahead and
return everything. Passing "*" to QueryParser was not pretty.

Thanks,
Patrick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]