lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guilherme Barile <...@prosoma.com.br>
Subject Re: query matching all documents
Date Wed, 21 May 2003 20:30:22 GMT
If you're trying to get all documents, why not

IndexReader reader = IndexReader.open(this.indexDir);
Document doc;
	
for (int i = 0; i < reader.maxDoc(); i++) {
	try {
		doc = reader.document(i);
		System.out.println(i + " " + doc.get("source"));
	}
	catch (Exception e) {
		System.out.println("Error getting doc " + i);
	}
}

this is just a simple example (i'm a newbie, but using this to list all
documents on a certain index)
you could add another loop inside the for so you could get all the
fields in a document (in this case I'm only getting the field named
"source") there are methods on the indexreader object for that.

see ya

gui

On Wed, 2003-05-21 at 17:16, David Medinets wrote:
> ----- Original Message -----
> From: <newsham@hotu.com>
> > > Is there a query object which can match all documents?
> > > I'd prefer not to add a dummy field to search by, as
> > > this is not efficient.
> 
> Why is the dummy field not efficient? I use something like a keyword of 'ZZ'
> and a value of 'A' so that the disk space used is minimal.
> 
> David Medinets
> http://www.codebits.com
> Need some R&D done? Let me know I'm looking for interesting projects.
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message