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 Albert Vila <av...@imente.com> on 2004/07/05 11:06:21 UTC

Using '*' wildcard in phrase searches

I wanna use the * in the middle of a phrase search like "java j2*". 
Anyone knows how can i achieve that?

Thanks,
Albert


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


Re: How to use QueryParser to query to get the index summary info?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 5, 2004, at 9:44 PM, Alex Aw Seat Kiong wrote:
> How to use QueryParser to query to get the index summary info, like?

QueryParser is not the appropriate place to get the information you 
want.  Use IndexReader instead.

> a. Last and first index document?

reader.document(0) and reader.document(reader.numDocs() - 1)  (assuming 
an optimized index with no deleted documents).

> b. Size of each document was indexed?

Lucene won't really be able to help, I don't think.  If you need this 
type of information, you probably should tally it during indexing.  You 
could certainly do some tricks with IndexReader to determine how terms 
and bytes and such a document takes up in Lucene, but I'm not sure that 
would be the best solution for what you're after.

> b. Total size of all documents were indexed?

Again, probably should tally this during indexing.  If you want to know 
the index size, look at the file system and see how big the files in 
the index directory are.  This is not the size of the original 
documents indexed - in fact, Lucene would really have no way of knowing 
that.

> c. Total count of all documents were indexed?

IndexReader.numDocs()

	Erik


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


How to use QueryParser to query to get the index summary info?

Posted by Alex Aw Seat Kiong <al...@bigonthenet.com>.
Hi!

How to use QueryParser to query to get the index summary info, like?
a. Last and first index document? 
b. Size of each document was indexed?
b. Total size of all documents were indexed?
c. Total count of all documents were indexed?
Anyone know about it?

Thanks.

Regards,
Alex

Re: Using '*' wildcard in phrase searches

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 5, 2004, at 5:06 AM, Albert Vila wrote:
> I wanna use the * in the middle of a phrase search like "java j2*". 
> Anyone knows how can i achieve that?

This is not possible with QueryParser, currently.

But through the API, you could (and it would take a little bit of code 
- see Lucene's test cases for more details) use a PhrasePrefixQuery to 
do this - it boils down to you manually expanding all the terms for 
j2*.

	Erik


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