org.apache.lucene.index
Class IndexSorter

java.lang.Object
  extended by org.apache.lucene.index.IndexSorter

public class IndexSorter
extends Object

Sort an index by document importance factor. Higher scoring documents are assigned smaller document numbers. Document weights are obtained from a specified field, which has to be single-valued and stored, with string value that represents a float number. Stored fields in the output index remain consistent, i.e. both stored fields and postings are renumbered in sync.

NOTE: this tool is unaware of documents added atomically via IndexWriter.addDocuments(java.util.Collection) or IndexWriter.updateDocuments(org.apache.lucene.index.Term, java.util.Collection), which means it can easily break up such document groups.


Constructor Summary
IndexSorter()
           
 
Method Summary
static void main(String[] args)
           
 void sort(org.apache.lucene.store.Directory input, org.apache.lucene.store.Directory output, String field)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSorter

public IndexSorter()
Method Detail

sort

public void sort(org.apache.lucene.store.Directory input,
                 org.apache.lucene.store.Directory output,
                 String field)
          throws IOException
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.