Package org.apache.lucene.index
Class IndexSorter
- java.lang.Object
-
- 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<org.apache.lucene.document.Document>)
orIndexWriter.updateDocuments(org.apache.lucene.index.Term, java.util.Collection<org.apache.lucene.document.Document>)
, which means it can easily break up such document groups.
-
-
Constructor Summary
Constructors Constructor Description IndexSorter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
void
sort(Directory input, Directory output, String field)
-
-
-
Method Detail
-
sort
public void sort(Directory input, Directory output, String field) throws IOException
- Throws:
IOException
-
-