public class Lucene
extends java.lang.Object
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Lucene.EarlyTerminatingCollectorA collector that terminates early by throwing  Lucene.EarlyTerminationExceptionwhen count of matched documents has reachedmaxCountHits | 
| static class  | Lucene.EarlyTerminationExceptionThis exception is thrown when  Lucene.EarlyTerminatingCollectorreaches early termination | 
| Modifier and Type | Field and Description | 
|---|---|
| static org.apache.lucene.search.ScoreDoc[] | EMPTY_SCORE_DOCS | 
| static org.apache.lucene.search.TopDocs | EMPTY_TOP_DOCS | 
| static NamedAnalyzer | KEYWORD_ANALYZER | 
| static java.lang.String | LATEST_CODEC | 
| static java.lang.String | LATEST_DOC_VALUES_FORMAT | 
| static java.lang.String | LATEST_POSTINGS_FORMAT | 
| static NamedAnalyzer | STANDARD_ANALYZER | 
| Modifier and Type | Method and Description | 
|---|---|
| static org.apache.lucene.util.Bits | asSequentialAccessBits(int maxDoc,
                      org.apache.lucene.search.ScorerSupplier scorerSupplier)Given a  ScorerSupplier, return aBitsinstance that will match
 all documents contained in the set. | 
| static void | checkSegmentInfoIntegrity(org.apache.lucene.store.Directory directory) | 
| static void | cleanLuceneIndex(org.apache.lucene.store.Directory directory)This method removes all lucene files from the given directory. | 
| static boolean | exists(org.apache.lucene.search.IndexSearcher searcher,
      org.apache.lucene.search.Query query)Check whether there is one or more documents matching the provided query. | 
| static java.lang.Iterable<java.lang.String> | files(org.apache.lucene.index.SegmentInfos infos)Returns an iterable that allows to iterate over all files in this segments info | 
| static int | getNumDocs(org.apache.lucene.index.SegmentInfos info)Returns the number of documents in the index referenced by this  SegmentInfos | 
| static org.apache.lucene.search.Scorer | illegalScorer(java.lang.String message)Return a Scorer that throws an ElasticsearchIllegalStateException
 on all operations with the given message. | 
| static boolean | indexExists(org.apache.lucene.store.Directory directory) | 
| static boolean | isCorruptionException(java.lang.Throwable t)Returns true iff the given exception or
 one of it's causes is an instance of  CorruptIndexException,IndexFormatTooOldException, orIndexFormatTooNewExceptionotherwise false. | 
| static org.apache.lucene.util.Version | parseVersion(java.lang.String version,
            org.apache.lucene.util.Version defaultVersion,
            org.apache.logging.log4j.Logger logger) | 
| static org.apache.lucene.util.Version | parseVersionLenient(java.lang.String toParse,
                   org.apache.lucene.util.Version defaultValue)Parses the version string lenient and returns the default value if the given string is null or emtpy | 
| static org.apache.lucene.index.SegmentInfos | pruneUnreferencedFiles(java.lang.String segmentsFileName,
                      org.apache.lucene.store.Directory directory)This method removes all files from the given directory that are not referenced by the given segments file. | 
| static org.apache.lucene.search.Explanation | readExplanation(StreamInput in) | 
| static org.apache.lucene.search.FieldDoc | readFieldDoc(StreamInput in) | 
| static org.apache.lucene.search.ScoreDoc | readScoreDoc(StreamInput in) | 
| static org.apache.lucene.index.SegmentInfos | readSegmentInfos(org.apache.lucene.store.Directory directory)Reads the segments infos, failing if it fails to load | 
| static org.apache.lucene.index.SegmentInfos | readSegmentInfos(org.apache.lucene.index.IndexCommit commit)Reads the segments infos from the given commit, failing if it fails to load | 
| static org.apache.lucene.search.SortField | readSortField(StreamInput in) | 
| static org.apache.lucene.search.SortField.Type | readSortType(StreamInput in) | 
| static org.apache.lucene.search.TopDocs | readTopDocs(StreamInput in) | 
| static boolean | waitForIndex(org.apache.lucene.store.Directory directory,
            long timeLimitMillis)Wait for an index to exist for up to  timeLimitMillis. | 
| static Lucene.EarlyTerminatingCollector | wrapCountBasedEarlyTerminatingCollector(org.apache.lucene.search.Collector delegate,
                                       int maxCountHits)Wraps  delegatewith count based early termination collector with a threshold ofmaxCountHits | 
| static org.apache.lucene.search.TimeLimitingCollector | wrapTimeLimitingCollector(org.apache.lucene.search.Collector delegate,
                         org.apache.lucene.util.Counter counter,
                         long timeoutInMillis)Wraps  delegatewith a time limited collector with a timeout oftimeoutInMillis | 
| static void | writeExplanation(StreamOutput out,
                org.apache.lucene.search.Explanation explanation) | 
| static void | writeFieldDoc(StreamOutput out,
             org.apache.lucene.search.FieldDoc fieldDoc) | 
| static void | writeScoreDoc(StreamOutput out,
             org.apache.lucene.search.ScoreDoc scoreDoc) | 
| static void | writeSortField(StreamOutput out,
              org.apache.lucene.search.SortField sortField) | 
| static void | writeSortType(StreamOutput out,
             org.apache.lucene.search.SortField.Type sortType) | 
| static void | writeTopDocs(StreamOutput out,
            org.apache.lucene.search.TopDocs topDocs) | 
public static final java.lang.String LATEST_DOC_VALUES_FORMAT
public static final java.lang.String LATEST_POSTINGS_FORMAT
public static final java.lang.String LATEST_CODEC
public static final NamedAnalyzer STANDARD_ANALYZER
public static final NamedAnalyzer KEYWORD_ANALYZER
public static final org.apache.lucene.search.ScoreDoc[] EMPTY_SCORE_DOCS
public static final org.apache.lucene.search.TopDocs EMPTY_TOP_DOCS
public static org.apache.lucene.util.Version parseVersion(@Nullable java.lang.String version, org.apache.lucene.util.Version defaultVersion, org.apache.logging.log4j.Logger logger)
public static org.apache.lucene.index.SegmentInfos readSegmentInfos(org.apache.lucene.store.Directory directory)
                                                             throws java.io.IOException
java.io.IOExceptionpublic static java.lang.Iterable<java.lang.String> files(org.apache.lucene.index.SegmentInfos infos)
                                                  throws java.io.IOException
java.io.IOExceptionpublic static int getNumDocs(org.apache.lucene.index.SegmentInfos info)
SegmentInfospublic static org.apache.lucene.index.SegmentInfos readSegmentInfos(org.apache.lucene.index.IndexCommit commit)
                                                             throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.SegmentInfos pruneUnreferencedFiles(java.lang.String segmentsFileName,
                                                                          org.apache.lucene.store.Directory directory)
                                                                   throws java.io.IOException
java.io.IOExceptionpublic static void cleanLuceneIndex(org.apache.lucene.store.Directory directory)
                             throws java.io.IOException
java.io.IOExceptionpublic static void checkSegmentInfoIntegrity(org.apache.lucene.store.Directory directory)
                                      throws java.io.IOException
java.io.IOExceptionpublic static final Lucene.EarlyTerminatingCollector wrapCountBasedEarlyTerminatingCollector(org.apache.lucene.search.Collector delegate, int maxCountHits)
delegate with count based early termination collector with a threshold of maxCountHitspublic static final org.apache.lucene.search.TimeLimitingCollector wrapTimeLimitingCollector(org.apache.lucene.search.Collector delegate,
                                                                                             org.apache.lucene.util.Counter counter,
                                                                                             long timeoutInMillis)
delegate with a time limited collector with a timeout of timeoutInMillispublic static boolean exists(org.apache.lucene.search.IndexSearcher searcher,
                             org.apache.lucene.search.Query query)
                      throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.TopDocs readTopDocs(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.FieldDoc readFieldDoc(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.ScoreDoc readScoreDoc(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static void writeTopDocs(StreamOutput out, org.apache.lucene.search.TopDocs topDocs) throws java.io.IOException
java.io.IOExceptionpublic static void writeFieldDoc(StreamOutput out, org.apache.lucene.search.FieldDoc fieldDoc) throws java.io.IOException
java.io.IOExceptionpublic static void writeScoreDoc(StreamOutput out, org.apache.lucene.search.ScoreDoc scoreDoc) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.SortField.Type readSortType(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.SortField readSortField(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static void writeSortType(StreamOutput out, org.apache.lucene.search.SortField.Type sortType) throws java.io.IOException
java.io.IOExceptionpublic static void writeSortField(StreamOutput out, org.apache.lucene.search.SortField sortField) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.Explanation readExplanation(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static void writeExplanation(StreamOutput out, org.apache.lucene.search.Explanation explanation) throws java.io.IOException
java.io.IOExceptionpublic static final boolean indexExists(org.apache.lucene.store.Directory directory)
                                 throws java.io.IOException
java.io.IOExceptionpublic static final boolean waitForIndex(org.apache.lucene.store.Directory directory,
                                         long timeLimitMillis)
                                  throws java.io.IOException
timeLimitMillis. Returns
 true if the index eventually exists, false if not.
 Will retry the directory every second for at least timeLimitMillisjava.io.IOExceptionpublic static boolean isCorruptionException(java.lang.Throwable t)
CorruptIndexException,
 IndexFormatTooOldException, or IndexFormatTooNewException otherwise false.public static org.apache.lucene.util.Version parseVersionLenient(java.lang.String toParse,
                                                                 org.apache.lucene.util.Version defaultValue)
public static org.apache.lucene.search.Scorer illegalScorer(java.lang.String message)
public static org.apache.lucene.util.Bits asSequentialAccessBits(int maxDoc,
                                                                 @Nullable
                                                                 org.apache.lucene.search.ScorerSupplier scorerSupplier)
                                                          throws java.io.IOException
ScorerSupplier, return a Bits instance that will match
 all documents contained in the set. Note that the returned Bits
 instance MUST be consumed in order.java.io.IOException