I use solr to search for documents and when trying to search for documents using this query \"id:*
\", I get this query parser exception telling that it cannot parse
id:[a* TO z*] id:[0* TO 9*] etc.
I just did this in lukeall on my index and it worked, therefore it should work in Solr which uses the standard query parser. I don't actually use Solr.
In base Lucene there's a fine reason for why you'd never query for every document, it's because to query for a document you must use a new indexReader("DirectoryName")
and apply a query to it. Therefore you could totally skip applying a query to it and use the indexReader
methods numDocs()
to get a count of all the documents, and document(int n)
to retrieve any of the documents.