> Hi all, > I'm upgrading my code to work with Lucene.net 2.9: is there anything I > should be aware of other then the obsolete methods? Any runtime change or > different default behavior? >
If you take a look to the changelog, you will find that some optimizations are made to the way the index are reloaded, so it's also recomended to reopen the indexes using the reopen method (this is the javadoc info, it's also aplicable for lucene.net): http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexReader.html#reopen() Opening an index is an expensive operation, and reopening one that has several changes it's also expensive, warming an indexreader, it's the operation of making some searchs so the internal caches of lucene objects are filled. So, the usual case is to spawn a new indexreader (via new indexreader or reopen), made some searchs on it, and then, asign the new reader to the active one. following the example in the reopen: IndexReader newReader = r.reopen(); // reader was reopened // made some searches with newreader here .... OldReader = reader; reader = newReader; OldReader .close(); On Tue, Jan 12, 2010 at 9:43 AM, Simone Chiaretta <[email protected]> wrote: > Then, among the obsolete methods: > I was counting the number of docs indexed by using a search with a certain > query: now the Query method requires the max number of results to return. > Is there a way to do an unbound query? > Or is there another way to count the number of total results? well, i don't already use lucene 2.9 and i can be mistaken, but that is the max number of documents to retrieve, however, the TopDocs class, has a totalhits field with the total number of results from the search. By the way, you query for a know term in every document, or you use the MatchAllDocsQuery? -- Jokin
