lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-java Wiki] Update of "LuceneFAQ" by HossMan
Date Fri, 26 Oct 2007 04:25:55 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-java Wiki" for change notification.

The following page has been changed by HossMan:
http://wiki.apache.org/lucene-java/LuceneFAQ

The comment on the change is:
not a FAQ

------------------------------------------------------------------------------
  This is the official Lucene FAQ.
  
- If you have a question about using Java Lucene, please do not add it directly to this FAQ.
 Join the [http://lucene.apache.org/java/docs/mailinglists.html Java User mailing list] and
email your question there.  Questions should only be added to this Wiki page when they already
have an answer that can be added at the same time.
+ If you have a question about using Java Lucene, please do not add it directly to this FAQ.
 Join the [http://lucene.apache.org/java/docs/mailinglists.html Java User mailing list] and
email your question there.  
+ 
+ '''''Questions should only be added to this Wiki page when they already have an answer that
can be added at the same time.'''''
  
  
  [[TableOfContents]]
@@ -369, +371 @@

    * Try to search or update an index with the lockDir configured to be on an NFS (or Samba)
mounted filesystem.
  
  Even though index searching is a read only operation, the !IndexSearcher must momentarily
lock the index when it is opened in order to get the list of files in the index.  If locking
is not configured properly it gets an incorrect list (because the list of files changes as
the !IndexWriter adds docs or optimizes the index).  Remote filesystems (like NFS and Samba)
rarely work, because they cannot make the transactional guarantees neccessary to ensure that
all clients get consistent views of the directory.
- 
- ==== Will TopDocCollector#collect(int doc, float score) operate on all documents? ====
- Does '''TopDocCollector''' continue to collect documents even when hq is full?
- IF NOT, does it mean that the collect operation DO NOT cover all the documents?
- Pls refer to lucene-2.2.0-src
- {{{
- class TopDocCollector extends HitCollector{
- // ...
-   private int numHits;//the maximum number of hits to collect.
-   PriorityQueue hq;
-   public TopDocCollector(int numHits) {
-     this(numHits, new HitQueue(numHits));
-   }
- 
-   TopDocCollector(int numHits, PriorityQueue hq) {
-     this.numHits = numHits;
-     this.hq = hq;
-   }
- // ...  
-   public void collect(int doc, float score) {
- 	if (score > 0.0f) {
- 		totalHits++;
- 		if (hq.size() < numHits || score >= minScore) { 
- 			hq.insert(new ScoreDoc(doc, score));        
- 			minScore = ((ScoreDoc)hq.top()).score; // maintain minScore     
- 		}   
- 	} 
-  }
- // ...
- }
- 
- }}}
- This code means that once the PriorityQueue is full, it will ONLY insert new documents if
the score of the new document is greater than the minimum score in the queue.  It does not
mean Lucene will stop scoring documents once the queue is full.
  
  === Indexing ===
  

Mime
View raw message