From de3b294be44c2cea51a5e909db05043aa8d15150 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Tue, 10 Oct 2023 16:15:44 -0400 Subject: [PATCH] GITHUB#12655: gradle tidy after google java format update for jdk 21 and regen * tidy whitespace changes from googleJavaFormat upgrade * generateForUtil fixed and regened https://bugs.python.org/issue39350 * generateAntlr * generateClassicTokenizer * generateWikipediaTokenizer --- .../checksums/generateClassicTokenizer.json | 2 +- .../checksums/generateWikipediaTokenizer.json | 2 +- .../lucene/analysis/cjk/CJKBigramFilter.java | 4 +++ .../classic/ClassicTokenizerImpl.java | 2 ++ .../lucene/analysis/de/GermanAnalyzer.java | 1 + .../email/UAX29URLEmailTokenizer.java | 9 +++++++ .../apache/lucene/analysis/en/KStemData1.java | 1 + .../lucene/analysis/hunspell/WordStorage.java | 1 + .../LimitTokenCountAnalyzer.java | 1 + .../miscellaneous/StemmerOverrideFilter.java | 1 + .../miscellaneous/TypeAsSynonymFilter.java | 1 + .../miscellaneous/WordDelimiterIterator.java | 2 ++ .../analysis/no/NorwegianLightStemmer.java | 1 + .../lucene/analysis/ro/RomanianAnalyzer.java | 1 + .../lucene/analysis/synonym/SynonymMap.java | 3 +++ .../synonym/word2vec/TermAndBoost.java | 1 + .../lucene/analysis/th/ThaiAnalyzer.java | 1 + .../lucene/analysis/tr/TurkishAnalyzer.java | 1 + .../util/SegmentingTokenizerBase.java | 3 +++ .../wikipedia/WikipediaTokenizer.java | 4 +++ .../wikipedia/WikipediaTokenizerImpl.java | 2 ++ .../analysis/bn/TestBengaliAnalyzer.java | 1 + .../analysis/core/TestFlattenGraphFilter.java | 1 + .../lucene/analysis/th/TestThaiAnalyzer.java | 1 + .../DefaultICUTokenizerConfig.java | 6 +++++ .../icu/segmentation/ICUTokenizer.java | 3 +++ .../icu/segmentation/ICUTokenizerConfig.java | 3 +++ .../icu/tokenattributes/ScriptAttribute.java | 3 +++ .../analysis/ja/dict/DictionaryConstants.java | 5 ++++ .../analysis/ja/dict/TokenInfoMorphData.java | 2 ++ .../analysis/ko/dict/DictionaryConstants.java | 5 ++++ .../phonetic/DaitchMokotoffSoundexFilter.java | 1 + .../DoubleMetaphoneFilterFactory.java | 2 ++ .../analysis/phonetic/PhoneticFilter.java | 2 ++ .../phonetic/PhoneticFilterFactory.java | 2 ++ .../src/java/org/egothor/stemmer/Cell.java | 3 +++ .../generated/checksums/generateForUtil.json | 4 +-- .../lucene40/blocktree/FieldReader.java | 1 + .../lucene50/Lucene50CompoundFormat.java | 1 + .../lucene50/Lucene50PostingsFormat.java | 5 ++++ ...Lucene50CompressingStoredFieldsFormat.java | 5 ++++ ...Lucene50CompressingStoredFieldsReader.java | 5 ++++ .../Lucene50CompressingTermVectorsFormat.java | 5 ++++ .../Lucene50CompressingTermVectorsReader.java | 2 ++ .../backward_codecs/lucene84/ForUtil.java | 1 + .../lucene84/Lucene84PostingsFormat.java | 5 ++++ .../backward_codecs/lucene84/gen_ForUtil.py | 2 +- .../lucene87/Lucene87Codec.java | 1 + .../lucene90/Lucene90HnswGraphBuilder.java | 1 + .../lucene90/Lucene90HnswVectorsFormat.java | 1 + .../lucene91/Lucene91HnswVectorsFormat.java | 1 + .../lucene94/Lucene94HnswVectorsFormat.java | 1 + .../packed/LegacyDirectMonotonicWriter.java | 1 + .../packed/LegacyPacked64.java | 4 +++ .../lucene50/Lucene50RWCompoundFormat.java | 1 + .../lucene60/bkd/BKDWriter60.java | 3 +++ .../lucene91/Lucene91HnswGraphBuilder.java | 1 + .../benchmark/byTask/feeds/LineDocSource.java | 2 ++ .../benchmark/quality/QualityStats.java | 2 ++ .../VariableGapTermsIndexWriter.java | 1 + .../codecs/blocktreeords/OrdsFieldReader.java | 1 + .../codecs/uniformsplit/BlockReader.java | 10 ++++++++ .../uniformsplit/IntersectBlockReader.java | 4 +++ .../UniformSplitPostingsFormat.java | 1 + .../uniformsplit/UniformSplitTermsWriter.java | 2 ++ .../STUniformSplitPostingsFormat.java | 1 + .../generated/checksums/generateForUtil.json | 4 +-- lucene/core/src/java/module-info.java | 1 + .../analysis/AbstractAnalysisFactory.java | 1 + .../org/apache/lucene/analysis/Analyzer.java | 1 + .../analysis/standard/StandardTokenizer.java | 7 ++++++ .../apache/lucene/codecs/BlockTermState.java | 2 ++ .../org/apache/lucene/codecs/CodecUtil.java | 1 + .../lucene/codecs/lucene90/ForUtil.java | 1 + .../lucene90/Lucene90CompoundFormat.java | 1 + .../lucene90/Lucene90PostingsFormat.java | 5 ++++ .../lucene90/blocktree/FieldReader.java | 1 + ...Lucene90CompressingStoredFieldsWriter.java | 3 +++ .../lucene/codecs/lucene90/gen_ForUtil.py | 2 +- .../lucene95/Lucene95HnswVectorsFormat.java | 2 ++ .../perfield/PerFieldPostingsFormat.java | 1 + .../lucene/document/InetAddressPoint.java | 1 + .../apache/lucene/document/LatLonPoint.java | 1 + .../apache/lucene/document/LongHashSet.java | 2 ++ .../lucene/document/RangeFieldQuery.java | 5 ++++ .../lucene/document/ShapeDocValues.java | 4 +++ .../apache/lucene/document/ShapeField.java | 10 ++++++++ .../apache/lucene/document/SpatialQuery.java | 1 + .../apache/lucene/document/XYPointField.java | 1 + .../java/org/apache/lucene/geo/Circle.java | 2 ++ .../java/org/apache/lucene/geo/Circle2D.java | 10 ++++++++ .../org/apache/lucene/geo/ComponentTree.java | 6 +++++ .../java/org/apache/lucene/geo/EdgeTree.java | 5 ++++ .../java/org/apache/lucene/geo/GeoUtils.java | 3 +++ .../src/java/org/apache/lucene/geo/Line.java | 4 +++ .../java/org/apache/lucene/geo/Line2D.java | 4 +++ .../src/java/org/apache/lucene/geo/Point.java | 1 + .../java/org/apache/lucene/geo/Polygon.java | 4 +++ .../java/org/apache/lucene/geo/Polygon2D.java | 5 ++++ .../java/org/apache/lucene/geo/Rectangle.java | 3 +++ .../java/org/apache/lucene/geo/XYCircle.java | 2 ++ .../java/org/apache/lucene/geo/XYLine.java | 4 +++ .../java/org/apache/lucene/geo/XYPoint.java | 1 + .../java/org/apache/lucene/geo/XYPolygon.java | 4 +++ .../org/apache/lucene/geo/XYRectangle.java | 3 +++ .../lucene/index/BaseCompositeReader.java | 1 + .../lucene/index/DocValuesFieldUpdates.java | 1 + .../org/apache/lucene/index/FieldInfo.java | 1 + .../lucene/index/FieldUpdatesBuffer.java | 6 +++++ .../lucene/index/FilterCodecReader.java | 1 + .../lucene/index/IndexReaderContext.java | 3 +++ .../org/apache/lucene/index/IndexWriter.java | 4 +++ .../lucene/index/LeafReaderContext.java | 1 + .../apache/lucene/index/MultiDocValues.java | 4 +++ .../org/apache/lucene/index/OrdinalMap.java | 1 + .../lucene/index/SegmentCoreReaders.java | 1 + .../org/apache/lucene/index/SegmentInfos.java | 2 ++ .../lucene/index/SegmentWriteState.java | 2 ++ .../SoftDeletesDirectoryReaderWrapper.java | 1 + .../SoftDeletesRetentionMergePolicy.java | 1 + .../lucene/index/TieredMergePolicy.java | 1 + .../apache/lucene/search/AutomatonQuery.java | 1 + .../apache/lucene/search/BoostAttribute.java | 2 ++ .../apache/lucene/search/IndexSearcher.java | 2 ++ .../MaxNonCompetitiveBoostAttribute.java | 3 +++ .../lucene/search/MultiPhraseQuery.java | 3 +++ .../apache/lucene/search/MultiTermQuery.java | 1 + .../org/apache/lucene/search/Scorable.java | 1 + .../lucene/search/TermCollectingRewrite.java | 1 + .../lucene/search/TimeLimitingCollector.java | 3 +++ .../search/similarities/BM25Similarity.java | 6 +++++ .../search/similarities/BasicStats.java | 5 ++++ .../search/similarities/DFRSimilarity.java | 2 ++ .../search/similarities/IBSimilarity.java | 2 ++ .../lucene/search/similarities/Lambda.java | 1 + .../apache/lucene/store/BufferedChecksum.java | 1 + .../lucene/store/ByteBuffersDataOutput.java | 2 ++ .../apache/lucene/store/NIOFSDirectory.java | 3 +++ .../lucene/store/RandomAccessInput.java | 2 ++ .../org/apache/lucene/util/ByteBlockPool.java | 2 ++ .../java/org/apache/lucene/util/CharsRef.java | 3 +++ .../org/apache/lucene/util/Constants.java | 5 ++++ .../org/apache/lucene/util/IntBlockPool.java | 3 +++ .../java/org/apache/lucene/util/IntsRef.java | 2 ++ .../java/org/apache/lucene/util/LongsRef.java | 2 ++ .../org/apache/lucene/util/MapOfSets.java | 1 + .../org/apache/lucene/util/OfflineSorter.java | 8 ++++++ .../org/apache/lucene/util/QueryBuilder.java | 1 + .../apache/lucene/util/SentinelIntSet.java | 1 + .../lucene/util/SortableBytesRefArray.java | 3 +++ .../org/apache/lucene/util/UnicodeUtil.java | 5 ++++ .../java/org/apache/lucene/util/Version.java | 3 +++ .../util/automaton/LevenshteinAutomata.java | 1 + .../apache/lucene/util/automaton/RegExp.java | 6 +++++ .../org/apache/lucene/util/bkd/BKDWriter.java | 7 ++++++ .../org/apache/lucene/util/fst/FSTEnum.java | 1 + .../java/org/apache/lucene/util/fst/Util.java | 2 ++ .../lucene/util/hnsw/HnswGraphBuilder.java | 1 + .../apache/lucene/util/packed/Packed64.java | 2 ++ .../apache/lucene/util/packed/PackedInts.java | 4 +++ .../lucene/index/TestPostingsOffsets.java | 1 + .../apache/lucene/search/TestBoolean2.java | 3 +++ .../TestSimpleExplanationsWithFillerDocs.java | 2 ++ .../similarities/TestSimilarityBase.java | 14 +++++++++++ .../demo/facet/CustomFacetSetExample.java | 1 + .../lucene/distribution/TestScripts.java | 1 + .../generated/checksums/generateAntlr.json | 4 +-- .../expressions/js/JavascriptBaseVisitor.java | 15 +++++++++++ .../expressions/js/JavascriptVisitor.java | 15 +++++++++++ .../range/ExclusiveLongRangeCounter.java | 3 +++ .../range/OverlappingLongRangeCounter.java | 4 +++ .../SortedSetDocValuesReaderState.java | 1 + .../lucene/search/grouping/DoubleRange.java | 1 + .../lucene/search/grouping/LongRange.java | 1 + .../lucene/search/highlight/Formatter.java | 1 + .../search/highlight/GradientFormatter.java | 1 + .../InvalidTokenOffsetsException.java | 1 + .../lucene/search/highlight/PositionSpan.java | 1 + .../highlight/SpanGradientFormatter.java | 1 + .../lucene/search/highlight/TextFragment.java | 3 +++ .../lucene/search/highlight/WeightedTerm.java | 1 + .../uhighlight/DefaultPassageFormatter.java | 3 +++ .../search/uhighlight/PassageScorer.java | 2 ++ .../vectorhighlight/FieldTermStack.java | 1 + .../search/join/ToParentBlockJoinQuery.java | 1 + .../lucene/index/memory/MemoryIndex.java | 1 + .../ByteWritesTrackingDirectoryWrapper.java | 1 + .../lucene/misc/store/RAFDirectory.java | 3 +++ .../apache/lucene/misc/TestHighFreqTerms.java | 1 + .../queries/function/FunctionValues.java | 1 + .../valuesource/DualFloatFunction.java | 1 + .../valuesource/MultiFloatFunction.java | 1 + .../lucene/queries/mlt/MoreLikeThis.java | 1 + .../payloads/SpanPayloadCheckQuery.java | 1 + .../queries/function/FunctionTestSetup.java | 4 +++ .../queries/function/TestValueSources.java | 3 +++ .../spans/BaseSpanExplanationTestCase.java | 2 ++ .../queries/spans/TestSpanSimilarity.java | 4 +++ .../queryparser/classic/QueryParserBase.java | 1 + .../lucene/queryparser/ext/Extensions.java | 1 + .../flexible/core/nodes/PathQueryNode.java | 1 + .../queryparser/simple/SimpleQueryParser.java | 10 ++++++++ .../surround/query/BasicQueryFactory.java | 1 + .../surround/query/SpanNearClauseFactory.java | 1 + .../classic/TestMultiAnalyzer.java | 1 + .../VersionBlockTreeTermsWriter.java | 1 + .../codecs/idversion/VersionFieldReader.java | 1 + .../document/FloatPointNearestNeighbor.java | 1 + .../index/MergeOnFlushMergePolicy.java | 1 + .../sandbox/search/MultiRangeQuery.java | 7 ++++++ .../sandbox/search/QueryProfilerTree.java | 4 +++ .../prefix/tree/NumberRangePrefixTree.java | 2 ++ .../spatial/query/SpatialOperation.java | 7 ++++++ .../prefix/tree/TestSpatialPrefixTree.java | 1 + .../lucene/spatial3d/geom/BaseXYZSolid.java | 6 +++++ .../lucene/spatial3d/geom/DistanceStyle.java | 4 +++ .../apache/lucene/spatial3d/geom/GeoArea.java | 3 +++ .../spatial3d/geom/GeoBaseAreaShape.java | 2 ++ .../geom/GeoBaseCompositeAreaShape.java | 2 ++ .../spatial3d/geom/GeoComplexPolygon.java | 2 ++ .../spatial3d/geom/GeoConcavePolygon.java | 10 ++++++++ .../spatial3d/geom/GeoConvexPolygon.java | 9 +++++++ .../geom/GeoDegenerateHorizontalLine.java | 6 +++++ .../geom/GeoDegenerateLatitudeZone.java | 5 ++++ .../geom/GeoDegenerateLongitudeSlice.java | 4 +++ .../spatial3d/geom/GeoDegeneratePath.java | 9 +++++++ .../spatial3d/geom/GeoDegeneratePoint.java | 1 + .../geom/GeoDegenerateVerticalLine.java | 9 +++++++ .../lucene/spatial3d/geom/GeoExactCircle.java | 4 +++ .../spatial3d/geom/GeoLatitudeZone.java | 9 +++++++ .../spatial3d/geom/GeoLongitudeSlice.java | 7 ++++++ .../spatial3d/geom/GeoNorthLatitudeZone.java | 6 +++++ .../spatial3d/geom/GeoNorthRectangle.java | 14 +++++++++++ .../lucene/spatial3d/geom/GeoPoint.java | 2 ++ .../spatial3d/geom/GeoPolygonFactory.java | 9 +++++++ .../lucene/spatial3d/geom/GeoRectangle.java | 14 +++++++++++ .../lucene/spatial3d/geom/GeoS2Shape.java | 9 +++++++ .../spatial3d/geom/GeoSouthLatitudeZone.java | 6 +++++ .../spatial3d/geom/GeoSouthRectangle.java | 10 ++++++++ .../spatial3d/geom/GeoStandardCircle.java | 4 +++ .../spatial3d/geom/GeoStandardPath.java | 23 +++++++++++++++++ .../geom/GeoWideDegenerateHorizontalLine.java | 5 ++++ .../spatial3d/geom/GeoWideLongitudeSlice.java | 2 ++ .../spatial3d/geom/GeoWideNorthRectangle.java | 7 ++++++ .../spatial3d/geom/GeoWideRectangle.java | 12 +++++++++ .../spatial3d/geom/GeoWideSouthRectangle.java | 7 ++++++ .../lucene/spatial3d/geom/GeoWorld.java | 1 + .../lucene/spatial3d/geom/LatLonBounds.java | 4 +++ .../apache/lucene/spatial3d/geom/Plane.java | 4 +++ .../lucene/spatial3d/geom/PlanetModel.java | 25 +++++++++++++++++++ .../spatial3d/geom/StandardObjects.java | 1 + .../spatial3d/geom/StandardXYZSolid.java | 21 ++++++++++++++++ .../apache/lucene/spatial3d/geom/Vector.java | 5 ++++ .../lucene/spatial3d/geom/XYZBounds.java | 5 ++++ .../lucene/spatial3d/geom/XYdZSolid.java | 8 ++++++ .../lucene/spatial3d/geom/XdYZSolid.java | 8 ++++++ .../lucene/spatial3d/geom/XdYdZSolid.java | 3 +++ .../lucene/spatial3d/geom/dXYZSolid.java | 8 ++++++ .../lucene/spatial3d/geom/dXYdZSolid.java | 3 +++ .../lucene/spatial3d/geom/dXdYZSolid.java | 3 +++ .../lucene/spatial3d/geom/dXdYdZSolid.java | 3 +++ .../lucene/spatial3d/geom/Geo3DUtil.java | 1 + .../search/spell/CombineSuggestion.java | 1 + .../search/spell/DirectSpellChecker.java | 10 ++++++++ .../lucene/search/spell/SpellChecker.java | 4 +++ .../search/suggest/BufferedInputIterator.java | 4 +++ .../search/suggest/DocumentDictionary.java | 1 + .../DocumentValueSourceDictionary.java | 3 +++ .../search/suggest/UnsortedInputIterator.java | 1 + .../analyzing/AnalyzingInfixSuggester.java | 1 + .../analyzing/SuggestStopFilterFactory.java | 1 + .../document/CompletionsTermsReader.java | 2 ++ .../search/suggest/document/ContextQuery.java | 1 + .../document/PrefixCompletionQuery.java | 1 + .../document/RegexCompletionQuery.java | 1 + .../search/suggest/fst/FSTCompletion.java | 1 + .../search/suggest/tst/TernaryTreeNode.java | 5 ++++ .../lucene/tests/analysis/MockTokenizer.java | 2 ++ .../lucene/tests/geo/EarthDebugger.java | 1 + .../tests/index/BaseMergePolicyTestCase.java | 1 + .../tests/index/MergingCodecReader.java | 1 + .../mockfile/FilterFileSystemProvider.java | 2 ++ .../lucene/tests/mockfile/WindowsFS.java | 1 + .../search/similarities/RandomSimilarity.java | 5 ++++ .../apache/lucene/tests/util/TimeUnits.java | 2 ++ .../lucene/tests/mockfile/TestVerboseFS.java | 1 + 286 files changed, 928 insertions(+), 10 deletions(-) diff --git a/lucene/analysis/common/src/generated/checksums/generateClassicTokenizer.json b/lucene/analysis/common/src/generated/checksums/generateClassicTokenizer.json index 13ebed4fefa..1e94a248e00 100644 --- a/lucene/analysis/common/src/generated/checksums/generateClassicTokenizer.json +++ b/lucene/analysis/common/src/generated/checksums/generateClassicTokenizer.json @@ -1,5 +1,5 @@ { "gradle/generation/jflex/skeleton.default.txt": "58944f66c9113a940dfaf6a17210ec8219024390", - "lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java": "381a9627fd7da6402216e3279cf81a09af222aaf", + "lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java": "1f7a446f3483326385eef257cea8366c27da0850", "lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.jflex": "f52109bb7d5701979fde90aeeeda726246a8d5fd" } \ No newline at end of file diff --git a/lucene/analysis/common/src/generated/checksums/generateWikipediaTokenizer.json b/lucene/analysis/common/src/generated/checksums/generateWikipediaTokenizer.json index ecb5f703a7e..0103898b52c 100644 --- a/lucene/analysis/common/src/generated/checksums/generateWikipediaTokenizer.json +++ b/lucene/analysis/common/src/generated/checksums/generateWikipediaTokenizer.json @@ -1,5 +1,5 @@ { "gradle/generation/jflex/skeleton.default.txt": "58944f66c9113a940dfaf6a17210ec8219024390", - "lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java": "d36e38342f984050b3a314f153b7a001a2d2be82", + "lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java": "ac298e08bc5b96202efca0c01f9f0376fda976bd", "lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex": "0b8c7774b98e8237702013e82c352d4711509bd0" } \ No newline at end of file diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java index a384dba2b85..ca69ecd9f89 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java @@ -53,15 +53,19 @@ public final class CJKBigramFilter extends TokenFilter { // configuration /** bigram flag for Han Ideographs */ public static final int HAN = 1; + /** bigram flag for Hiragana */ public static final int HIRAGANA = 2; + /** bigram flag for Katakana */ public static final int KATAKANA = 4; + /** bigram flag for Hangul */ public static final int HANGUL = 8; /** when we emit a bigram, it's then marked as this type */ public static final String DOUBLE_TYPE = ""; + /** when we emit a unigram, it's then marked as this type */ public static final String SINGLE_TYPE = ""; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java index dd5e4303965..12098b10697 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java @@ -297,8 +297,10 @@ class ClassicTokenizerImpl { /** Error code for "Unknown internal scanner error". */ private static final int ZZ_UNKNOWN_ERROR = 0; + /** Error code for "could not match input". */ private static final int ZZ_NO_MATCH = 1; + /** Error code for "pushback value was too large". */ private static final int ZZ_PUSHBACK_2BIG = 2; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java index d24de0d3c68..c6dcc8190b7 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.analysis.de; + // This file is encoded in UTF-8 import java.io.IOException; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizer.java index a33c4ea7e46..c2082888d01 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizer.java @@ -38,22 +38,31 @@ public final class UAX29URLEmailTokenizer extends Tokenizer { /** Alpha/numeric token type */ public static final int ALPHANUM = 0; + /** Numeric token type */ public static final int NUM = 1; + /** Southeast Asian token type */ public static final int SOUTHEAST_ASIAN = 2; + /** Ideographic token type */ public static final int IDEOGRAPHIC = 3; + /** Hiragana token type */ public static final int HIRAGANA = 4; + /** Katakana token type */ public static final int KATAKANA = 5; + /** Hangul token type */ public static final int HANGUL = 6; + /** URL token type */ public static final int URL = 7; + /** Email token type */ public static final int EMAIL = 8; + /** Emoji token type. */ public static final int EMOJI = 9; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemData1.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemData1.java index 04086be7362..2eff93951dc 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemData1.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemData1.java @@ -42,6 +42,7 @@ package org.apache.lucene.analysis.en; /** A list of words used by Kstem */ class KStemData1 { private KStemData1() {} + // KStemData1 ... KStemData8 are created from "head_word_list.txt" static String[] data = { "aback", "abacus", "abandon", "abandoned", "abase", diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/WordStorage.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/WordStorage.java index 82cf3153ace..0b5e4b86978 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/WordStorage.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/WordStorage.java @@ -56,6 +56,7 @@ abstract class WordStorage { private static final int MAX_STORED_LENGTH = SUGGESTIBLE_MASK - 1; private final int maxEntryLength; private final boolean hasCustomMorphData; + /** * A map from word's hash (modulo array's length) into an int containing: * diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LimitTokenCountAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LimitTokenCountAnalyzer.java index 604b5f09a07..60b8b455aee 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LimitTokenCountAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LimitTokenCountAnalyzer.java @@ -40,6 +40,7 @@ public final class LimitTokenCountAnalyzer extends AnalyzerWrapper { public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount) { this(delegate, maxTokenCount, false); } + /** * Build an analyzer that limits the maximum number of tokens per field. * diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java index faa7ce1413e..ad47d702f64 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java @@ -151,6 +151,7 @@ public final class StemmerOverrideFilter extends TokenFilter { return matchOutput; } } + /** This builder builds an {@link FST} for the {@link StemmerOverrideFilter} */ public static class Builder { private final BytesRefHash hash = new BytesRefHash(); diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/TypeAsSynonymFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/TypeAsSynonymFilter.java index a31388a5919..598e7c68813 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/TypeAsSynonymFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/TypeAsSynonymFilter.java @@ -47,6 +47,7 @@ public final class TypeAsSynonymFilter extends TokenFilter { public TypeAsSynonymFilter(TokenStream input) { this(input, null, null, ~0); } + /** * @param input input tokenstream * @param prefix Prepend this string to every token type emitted as token text. If null, nothing diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java index 8b928d1f5d6..50275d68126 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java @@ -45,11 +45,13 @@ public final class WordDelimiterIterator { /** start position of text, excluding leading delimiters */ int startBounds; + /** end position of text, excluding trailing delimiters */ int endBounds; /** Beginning of subword */ int current; + /** End of subword */ int end; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java index f6bb198b1ee..b17c0c51fbb 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java @@ -63,6 +63,7 @@ import static org.apache.lucene.analysis.util.StemmerUtil.*; class NorwegianLightStemmer { /** Constant to remove Bokmål-specific endings */ static final int BOKMAAL = 1; + /** Constant to remove Nynorsk-specific endings */ static final int NYNORSK = 2; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java index 12f74653ef4..f8357ef7f85 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java @@ -43,6 +43,7 @@ public final class RomanianAnalyzer extends StopwordAnalyzerBase { /** File containing default Romanian stopwords. */ public static final String DEFAULT_STOPWORD_FILE = "stopwords.txt"; + /** The comment character in the stopwords file. All lines prefixed with this will be ignored. */ private static final String STOPWORDS_COMMENT = "#"; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java index 3a31cf8b996..b92b9228860 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java @@ -48,10 +48,13 @@ import org.apache.lucene.util.fst.Util; public class SynonymMap { /** for multiword support, you must separate words with this separator */ public static final char WORD_SEPARATOR = 0; + /** map<input word, list<ord>> */ public final FST fst; + /** map<ord, outputword> */ public final BytesRefHash words; + /** maxHorizontalContext: maximum context we need on the tokenstream */ public final int maxHorizontalContext; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/TermAndBoost.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/TermAndBoost.java index 03fdeecb0f2..349fa57c34a 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/TermAndBoost.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/TermAndBoost.java @@ -22,6 +22,7 @@ import org.apache.lucene.util.BytesRef; public class TermAndBoost { /** the term */ public final BytesRef term; + /** the boost */ public final float boost; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java index c5b2b11ce95..12595982f9a 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java @@ -39,6 +39,7 @@ public final class ThaiAnalyzer extends StopwordAnalyzerBase { /** File containing default Thai stopwords. */ public static final String DEFAULT_STOPWORD_FILE = "stopwords.txt"; + /** The comment character in the stopwords file. All lines prefixed with this will be ignored. */ private static final String STOPWORDS_COMMENT = "#"; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java index c676445820e..b25a0fd69ea 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java @@ -42,6 +42,7 @@ public final class TurkishAnalyzer extends StopwordAnalyzerBase { /** File containing default Turkish stopwords. */ public static final String DEFAULT_STOPWORD_FILE = "stopwords.txt"; + /** The comment character in the stopwords file. All lines prefixed with this will be ignored. */ private static final String STOPWORDS_COMMENT = "#"; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/SegmentingTokenizerBase.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/SegmentingTokenizerBase.java index f82ff7575a4..9131ec3e456 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/SegmentingTokenizerBase.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/SegmentingTokenizerBase.java @@ -38,10 +38,13 @@ import org.apache.lucene.util.AttributeFactory; public abstract class SegmentingTokenizerBase extends Tokenizer { protected static final int BUFFERMAX = 1024; protected final char[] buffer = new char[BUFFERMAX]; + /** true length of text in the buffer */ private int length = 0; + /** length in buffer that can be evaluated safely, up to a safe end point */ private int usableLength = 0; + /** accumulated offset of previous buffers for this reader, for offsetAtt */ protected int offset = 0; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java index 099c5221bc1..0241e1382eb 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java @@ -97,18 +97,22 @@ public final class WikipediaTokenizer extends Tokenizer { /** Only output tokens */ public static final int TOKENS_ONLY = 0; + /** * Only output untokenized tokens, which are tokens that would normally be split into several * tokens */ public static final int UNTOKENIZED_ONLY = 1; + /** Output the both the untokenized token and the splits */ public static final int BOTH = 2; + /** * This flag is used to indicate that the produced "Token" would, if {@link #TOKENS_ONLY} was * used, produce multiple tokens. */ public static final int UNTOKENIZED_TOKEN_FLAG = 1; + /** A private instance of the JFlex-constructed scanner */ private final WikipediaTokenizerImpl scanner; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java index ced90703f5e..f2be4f59973 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java @@ -402,8 +402,10 @@ class WikipediaTokenizerImpl { /** Error code for "Unknown internal scanner error". */ private static final int ZZ_UNKNOWN_ERROR = 0; + /** Error code for "could not match input". */ private static final int ZZ_NO_MATCH = 1; + /** Error code for "pushback value was too large". */ private static final int ZZ_PUSHBACK_2BIG = 2; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java index 148b9f147ac..f44881a5141 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java @@ -33,6 +33,7 @@ public class TestBengaliAnalyzer extends BaseTokenStreamTestCase { checkOneTerm(a, "বারী", "বার"); a.close(); } + /** test Digits */ public void testDigits() throws Exception { BengaliAnalyzer a = new BengaliAnalyzer(); diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java index 7fa901ac5bf..eafd62387a4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java @@ -611,6 +611,7 @@ public class TestFlattenGraphFilter extends BaseTokenStreamTestCase { new int[] {1, 1, 3, 1, 2, 1, 1, 1}, 7); } + // This graph can create a disconnected input node that is farther ahead in the output than its // subsequent input node. // Exceptions: Free too early or dropped tokens. diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java index ff4591a1079..bd8c9f8440a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java @@ -32,6 +32,7 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase { assumeTrue( "JRE does not support Thai dictionary-based BreakIterator", ThaiTokenizer.DBBI_AVAILABLE); } + /* * testcase for offsets */ diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java index 9f815a685bf..09b23546f96 100644 --- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java +++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java @@ -41,19 +41,25 @@ public class DefaultICUTokenizerConfig extends ICUTokenizerConfig { /** Token type for words containing ideographic characters */ public static final String WORD_IDEO = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.IDEOGRAPHIC]; + /** Token type for words containing Japanese hiragana */ public static final String WORD_HIRAGANA = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HIRAGANA]; + /** Token type for words containing Japanese katakana */ public static final String WORD_KATAKANA = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.KATAKANA]; + /** Token type for words containing Korean hangul */ public static final String WORD_HANGUL = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HANGUL]; + /** Token type for words that contain letters */ public static final String WORD_LETTER = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.ALPHANUM]; + /** Token type for words that appear to be numbers */ public static final String WORD_NUMBER = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.NUM]; + /** Token type for words that appear to be emoji sequences */ public static final String WORD_EMOJI = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.EMOJI]; diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java index 41918d17ee4..3b33cd5475d 100644 --- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java +++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java @@ -40,10 +40,13 @@ import org.apache.lucene.util.AttributeFactory; public final class ICUTokenizer extends Tokenizer { private static final int IOBUFFER = 4096; private final char[] buffer = new char[IOBUFFER]; + /** true length of text in the buffer */ private int length = 0; + /** length in buffer that can be evaluated safely, up to a safe end point */ private int usableLength = 0; + /** accumulated offset of previous buffers for this reader, for offsetAtt */ private int offset = 0; diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizerConfig.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizerConfig.java index 615f5281603..9d05c438716 100644 --- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizerConfig.java +++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizerConfig.java @@ -29,10 +29,13 @@ public abstract class ICUTokenizerConfig { /** Sole constructor. (For invocation by subclass constructors, typically implicit.) */ public ICUTokenizerConfig() {} + /** Return a breakiterator capable of processing a given script. */ public abstract RuleBasedBreakIterator getBreakIterator(int script); + /** Return a token type value for a given script and BreakIterator rule status. */ public abstract String getType(int script, int ruleStatus); + /** true if Han, Hiragana, and Katakana scripts should all be returned as Japanese */ public abstract boolean combineCJ(); } diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttribute.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttribute.java index 73ce7465c57..ed84f5f8b62 100644 --- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttribute.java +++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttribute.java @@ -31,18 +31,21 @@ public interface ScriptAttribute extends Attribute { * @return numeric code */ public int getCode(); + /** * Set the numeric code for this script value. This is the constant value from {@link UScript}. * * @param code numeric code */ public void setCode(int code); + /** * Get the full name. * * @return UTR #24 full name. */ public String getName(); + /** * Get the abbreviated name. * diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/DictionaryConstants.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/DictionaryConstants.java index f58a1521c1b..9e7b391ceaf 100644 --- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/DictionaryConstants.java +++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/DictionaryConstants.java @@ -20,14 +20,19 @@ package org.apache.lucene.analysis.ja.dict; final class DictionaryConstants { /** Codec header of the dictionary file. */ public static final String DICT_HEADER = "kuromoji_dict"; + /** Codec header of the dictionary mapping file. */ public static final String TARGETMAP_HEADER = "kuromoji_dict_map"; + /** Codec header of the POS dictionary file. */ public static final String POSDICT_HEADER = "kuromoji_dict_pos"; + /** Codec header of the connection costs. */ public static final String CONN_COSTS_HEADER = "kuromoji_cc"; + /** Codec header of the character definition file. */ public static final String CHARDEF_HEADER = "kuromoji_cd"; + /** Codec version of the binary dictionary */ public static final int VERSION = 1; } diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/TokenInfoMorphData.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/TokenInfoMorphData.java index ab31e097e6f..088f1a9300e 100644 --- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/TokenInfoMorphData.java +++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/TokenInfoMorphData.java @@ -205,10 +205,12 @@ class TokenInfoMorphData implements JaMorphData { /** flag that the entry has baseform data. otherwise it's not inflected (same as surface form) */ public static final int HAS_BASEFORM = 1; + /** * flag that the entry has reading data. otherwise reading is surface form converted to katakana */ public static final int HAS_READING = 2; + /** flag that the entry has pronunciation data. otherwise pronunciation is the reading */ public static final int HAS_PRONUNCIATION = 4; } diff --git a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/dict/DictionaryConstants.java b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/dict/DictionaryConstants.java index aee489eb880..002ca84ae47 100644 --- a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/dict/DictionaryConstants.java +++ b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/dict/DictionaryConstants.java @@ -20,14 +20,19 @@ package org.apache.lucene.analysis.ko.dict; final class DictionaryConstants { /** Codec header of the dictionary file. */ public static final String DICT_HEADER = "ko_dict"; + /** Codec header of the dictionary mapping file. */ public static final String TARGETMAP_HEADER = "ko_dict_map"; + /** Codec header of the POS dictionary file. */ public static final String POSDICT_HEADER = "ko_dict_pos"; + /** Codec header of the connection costs file. */ public static final String CONN_COSTS_HEADER = "ko_cc"; + /** Codec header of the character definition file */ public static final String CHARDEF_HEADER = "ko_cd"; + /** Codec version of the binary dictionary */ public static final int VERSION = 1; } diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java index c93fb8cf3b0..5f6f0119178 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java @@ -33,6 +33,7 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; public final class DaitchMokotoffSoundexFilter extends TokenFilter { /** true if encoded tokens should be added as synonyms */ protected boolean inject = true; + /** phonetic encoder */ protected DaitchMokotoffSoundex encoder = new DaitchMokotoffSoundex(); diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DoubleMetaphoneFilterFactory.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DoubleMetaphoneFilterFactory.java index 835e6025f7a..71e36640b4f 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DoubleMetaphoneFilterFactory.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DoubleMetaphoneFilterFactory.java @@ -41,8 +41,10 @@ public class DoubleMetaphoneFilterFactory extends TokenFilterFactory { /** parameter name: true if encoded tokens should be added as synonyms */ public static final String INJECT = "inject"; + /** parameter name: restricts the length of the phonetic code */ public static final String MAX_CODE_LENGTH = "maxCodeLength"; + /** default maxCodeLength if not specified */ public static final int DEFAULT_MAX_CODE_LENGTH = 4; diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java index f5098837a1a..0212c97fac9 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java @@ -33,8 +33,10 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; public final class PhoneticFilter extends TokenFilter { /** true if encoded tokens should be added as synonyms */ protected boolean inject = true; + /** phonetic encoder */ protected Encoder encoder = null; + /** captured state, non-null when inject=true and a token is buffered */ protected State save = null; diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilterFactory.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilterFactory.java index 15a454202da..e1df2e3408a 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilterFactory.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilterFactory.java @@ -75,8 +75,10 @@ public class PhoneticFilterFactory extends TokenFilterFactory implements Resourc /** parameter name: either a short name or a full class name */ public static final String ENCODER = "encoder"; + /** parameter name: true if encoded tokens should be added as synonyms */ public static final String INJECT = "inject"; // boolean + /** parameter name: restricts the length of the phonetic code */ public static final String MAX_CODE_LENGTH = "maxCodeLength"; diff --git a/lucene/analysis/stempel/src/java/org/egothor/stemmer/Cell.java b/lucene/analysis/stempel/src/java/org/egothor/stemmer/Cell.java index 0d47b27d65b..3804d095882 100644 --- a/lucene/analysis/stempel/src/java/org/egothor/stemmer/Cell.java +++ b/lucene/analysis/stempel/src/java/org/egothor/stemmer/Cell.java @@ -58,10 +58,13 @@ package org.egothor.stemmer; class Cell { /** next row id in this way */ int ref = -1; + /** command of the cell */ int cmd = -1; + /** how many cmd-s was in subtrie before pack() */ int cnt = 0; + /** how many chars would be discarded from input key in this way */ int skip = 0; diff --git a/lucene/backward-codecs/src/generated/checksums/generateForUtil.json b/lucene/backward-codecs/src/generated/checksums/generateForUtil.json index da9642f3841..578b47eefdc 100644 --- a/lucene/backward-codecs/src/generated/checksums/generateForUtil.json +++ b/lucene/backward-codecs/src/generated/checksums/generateForUtil.json @@ -1,4 +1,4 @@ { - "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java": "e91aafa414018b34a39c8f0947ff58c1f1dde78d", - "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py": "7be3f1e17c9055d68a8ad6b0d6321481dcc4d711" + "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java": "c3bff5677f7d98fbb362018a4c1dbad4d670610f", + "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py": "e3c0b1d1d9fcc9f04ae8870e40aab44133321272" } \ No newline at end of file diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene40/blocktree/FieldReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene40/blocktree/FieldReader.java index 0ede1172be2..b30e6ef2fd7 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene40/blocktree/FieldReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene40/blocktree/FieldReader.java @@ -50,6 +50,7 @@ public final class FieldReader extends Terms { final Lucene40BlockTreeTermsReader parent; final FST index; + // private boolean DEBUG; FieldReader( diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50CompoundFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50CompoundFormat.java index 75d6912d41d..d473efa14a4 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50CompoundFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50CompoundFormat.java @@ -64,6 +64,7 @@ public final class Lucene50CompoundFormat extends CompoundFormat { /** Extension of compound file */ static final String DATA_EXTENSION = "cfs"; + /** Extension of compound file entries */ static final String ENTRIES_EXTENSION = "cfe"; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50PostingsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50PostingsFormat.java index 27191a76749..1d08136cb99 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50PostingsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50PostingsFormat.java @@ -405,20 +405,25 @@ public class Lucene50PostingsFormat extends PostingsFormat { public static final class IntBlockTermState extends BlockTermState { /** file pointer to the start of the doc ids enumeration, in {@link #DOC_EXTENSION} file */ public long docStartFP; + /** file pointer to the start of the positions enumeration, in {@link #POS_EXTENSION} file */ public long posStartFP; + /** file pointer to the start of the payloads enumeration, in {@link #PAY_EXTENSION} file */ public long payStartFP; + /** * file offset for the start of the skip list, relative to docStartFP, if there are more than * {@link #BLOCK_SIZE} docs; otherwise -1 */ public long skipOffset; + /** * file offset for the last position in the last block, if there are more than {@link * #BLOCK_SIZE} positions; otherwise -1 */ public long lastPosBlockOffset; + /** * docid when there is a single pulsed posting, otherwise -1. freq is always implicitly * totalTermFreq in this case. diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsFormat.java index 577ddef82f3..a1be277abc7 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsFormat.java @@ -45,14 +45,19 @@ public class Lucene50CompressingStoredFieldsFormat extends StoredFieldsFormat { /** format name */ protected final String formatName; + /** segment suffix */ protected final String segmentSuffix; + /** compression mode */ protected final CompressionMode compressionMode; + /** chunk size */ protected final int chunkSize; + /** max docs per chunk */ protected final int maxDocsPerChunk; + /** block shift */ protected final int blockShift; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsReader.java index a451874f907..8c6ea3264ab 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingStoredFieldsReader.java @@ -54,10 +54,13 @@ public final class Lucene50CompressingStoredFieldsReader extends StoredFieldsRea /** Extension of stored fields file */ public static final String FIELDS_EXTENSION = "fdt"; + /** Extension of stored fields index */ public static final String INDEX_EXTENSION = "fdx"; + /** Extension of stored fields meta */ public static final String META_EXTENSION = "fdm"; + /** Codec name for the index. */ public static final String INDEX_CODEC_NAME = "Lucene85FieldsIndex"; @@ -73,8 +76,10 @@ public final class Lucene50CompressingStoredFieldsReader extends StoredFieldsRea static final int VERSION_START = 1; static final int VERSION_OFFHEAP_INDEX = 2; + /** Version where all metadata were moved to the meta file. */ static final int VERSION_META = 3; + /** * Version where numChunks is explicitly recorded in meta file and a dirty chunk bit is recorded * in each chunk diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsFormat.java index 0825f5762eb..7abf5772577 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsFormat.java @@ -38,14 +38,19 @@ public class Lucene50CompressingTermVectorsFormat extends TermVectorsFormat { /** format name */ protected final String formatName; + /** segment suffix */ protected final String segmentSuffix; + /** compression mode */ protected final CompressionMode compressionMode; + /** chunk size */ protected final int chunkSize; + /** block size */ protected final int blockSize; + /** max docs per chunk */ protected final int maxDocsPerChunk; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java index cde22da5f95..3fe18c0e0cc 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java @@ -64,8 +64,10 @@ public final class Lucene50CompressingTermVectorsReader extends TermVectorsReade static final int VERSION_START = 1; static final int VERSION_OFFHEAP_INDEX = 2; + /** Version where all metadata were moved to the meta file. */ static final int VERSION_META = 3; + /** Version where numChunks is explicitly recorded in meta file */ static final int VERSION_NUM_CHUNKS = 4; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java index ec9963c2d0b..f7d1f6c501b 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java @@ -368,6 +368,7 @@ final class ForUtil { MASKS32[i] = mask32(i); } } + // mark values in array as final longs to avoid the cost of reading array, arrays should only be // used when the idx is a variable private static final long MASK8_1 = MASKS8[1]; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/Lucene84PostingsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/Lucene84PostingsFormat.java index 2e524effc8f..0c63d244fbc 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/Lucene84PostingsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/Lucene84PostingsFormat.java @@ -405,20 +405,25 @@ public class Lucene84PostingsFormat extends PostingsFormat { public static final class IntBlockTermState extends BlockTermState { /** file pointer to the start of the doc ids enumeration, in {@link #DOC_EXTENSION} file */ public long docStartFP; + /** file pointer to the start of the positions enumeration, in {@link #POS_EXTENSION} file */ public long posStartFP; + /** file pointer to the start of the payloads enumeration, in {@link #PAY_EXTENSION} file */ public long payStartFP; + /** * file offset for the start of the skip list, relative to docStartFP, if there are more than * {@link ForUtil#BLOCK_SIZE} docs; otherwise -1 */ public long skipOffset; + /** * file offset for the last position in the last block, if there are more than {@link * ForUtil#BLOCK_SIZE} positions; otherwise -1 */ public long lastPosBlockOffset; + /** * docid when there is a single pulsed posting, otherwise -1. freq is always implicitly * totalTermFreq in this case. diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py index 74159e97b87..4e90a11571a 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fractions import gcd +from math import gcd """Code generation for ForUtil.java""" diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java index 851231d8204..53a235ab082 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java @@ -64,6 +64,7 @@ public class Lucene87Codec extends Codec { /** compression mode for stored fields */ protected final Lucene87StoredFieldsFormat.Mode storedMode; + /** compression mode for doc value fields */ protected final Lucene80DocValuesFormat.Mode dvMode; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswGraphBuilder.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswGraphBuilder.java index 4b1f7068a5f..196e3b24b79 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswGraphBuilder.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswGraphBuilder.java @@ -37,6 +37,7 @@ public final class Lucene90HnswGraphBuilder { /** Default random seed for level generation * */ private static final long DEFAULT_RAND_SEED = 42; + /** A name for the HNSW component for the info-stream * */ public static final String HNSW_COMPONENT = "HNSW"; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsFormat.java index 3587b3daaf9..a5c7543ed25 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsFormat.java @@ -79,6 +79,7 @@ public class Lucene90HnswVectorsFormat extends KnnVectorsFormat { /** Default number of maximum connections per node */ public static final int DEFAULT_MAX_CONN = 16; + /** * Default number of the size of the queue maintained while searching and the number of random * entry points to sample during a graph construction. diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswVectorsFormat.java index 23789ebb85f..98fc4329c67 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswVectorsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswVectorsFormat.java @@ -96,6 +96,7 @@ public class Lucene91HnswVectorsFormat extends KnnVectorsFormat { /** Default number of maximum connections per node */ public static final int DEFAULT_MAX_CONN = 16; + /** * Default number of the size of the queue maintained while searching during a graph construction. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/Lucene94HnswVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/Lucene94HnswVectorsFormat.java index 4aab315d674..4a0d4866ea8 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/Lucene94HnswVectorsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/Lucene94HnswVectorsFormat.java @@ -110,6 +110,7 @@ public class Lucene94HnswVectorsFormat extends KnnVectorsFormat { /** Default number of maximum connections per node */ public static final int DEFAULT_MAX_CONN = 16; + /** * Default number of the size of the queue maintained while searching during a graph construction. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyDirectMonotonicWriter.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyDirectMonotonicWriter.java index b630644fe7e..d96c17b0f6f 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyDirectMonotonicWriter.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyDirectMonotonicWriter.java @@ -32,6 +32,7 @@ public final class LegacyDirectMonotonicWriter { /** min block shift */ public static final int MIN_BLOCK_SHIFT = 2; + /** max block shift */ public static final int MAX_BLOCK_SHIFT = 22; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyPacked64.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyPacked64.java index ffd476315ec..e99c94a2dcc 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyPacked64.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/packed/LegacyPacked64.java @@ -31,12 +31,16 @@ class LegacyPacked64 extends PackedInts.Reader { /** Values are stores contiguously in the blocks array. */ private final long[] blocks; + /** A right-aligned mask of width BitsPerValue used by {@link #get(int)}. */ private final long maskRight; + /** Optimization: Saves one lookup in {@link #get(int)}. */ private final int bpvMinusBlockSize; + /** number of values */ protected final int valueCount; + /** bits per value. */ protected final int bitsPerValue; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/Lucene50RWCompoundFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/Lucene50RWCompoundFormat.java index 346a3f6b30f..2817b19828d 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/Lucene50RWCompoundFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/Lucene50RWCompoundFormat.java @@ -68,6 +68,7 @@ public final class Lucene50RWCompoundFormat extends CompoundFormat { /** Extension of compound file */ static final String DATA_EXTENSION = "cfs"; + /** Extension of compound file entries */ static final String ENTRIES_EXTENSION = "cfe"; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/bkd/BKDWriter60.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/bkd/BKDWriter60.java index adca1b62170..dccd4f745ab 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/bkd/BKDWriter60.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/bkd/BKDWriter60.java @@ -329,10 +329,13 @@ public class BKDWriter60 implements Closeable { private final int packedBytesLength; private final MergeState.DocMap docMap; private final MergeIntersectsVisitor mergeIntersectsVisitor; + /** Which doc in this block we are up to */ private int docBlockUpto; + /** Current doc ID */ public int docID; + /** Current packed value */ public final byte[] packedValue; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswGraphBuilder.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswGraphBuilder.java index 55738b61d7f..99dd1c1ebe6 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswGraphBuilder.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene91/Lucene91HnswGraphBuilder.java @@ -42,6 +42,7 @@ public final class Lucene91HnswGraphBuilder { /** Default random seed for level generation * */ private static final long DEFAULT_RAND_SEED = 42; + /** A name for the HNSW component for the info-stream * */ public static final String HNSW_COMPONENT = "HNSW"; diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java index 46828ae8364..813adf04773 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java @@ -53,6 +53,7 @@ public class LineDocSource extends ContentSource { /** Reader of a single input line into {@link DocData}. */ public abstract static class LineParser { protected final String[] header; + /** * Construct with the header * @@ -61,6 +62,7 @@ public class LineDocSource extends ContentSource { public LineParser(String[] header) { this.header = header; } + /** parse an input line and fill doc data appropriately */ public abstract void parseLine(DocData docData, String line); } diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityStats.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityStats.java index bda1e55779f..2215d493b6f 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityStats.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityStats.java @@ -46,10 +46,12 @@ public class QualityStats { this.rank = rank; this.recall = recall; } + /** Returns the rank: where on the list of returned docs this relevant doc appeared. */ public int getRank() { return rank; } + /** Returns the recall: how many relevant docs were returned up to this point, inclusive. */ public double getRecall() { return recall; diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/VariableGapTermsIndexWriter.java b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/VariableGapTermsIndexWriter.java index b94b245d051..f15650670a1 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/VariableGapTermsIndexWriter.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/VariableGapTermsIndexWriter.java @@ -74,6 +74,7 @@ public class VariableGapTermsIndexWriter extends TermsIndexWriterBase { * indexed */ public abstract boolean isIndexTerm(BytesRef term, TermStats stats); + /** Called when a new field is started. */ public abstract void newField(FieldInfo fieldInfo); } diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/OrdsFieldReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/OrdsFieldReader.java index a5444de6189..486724a0098 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/OrdsFieldReader.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/OrdsFieldReader.java @@ -43,6 +43,7 @@ final class OrdsFieldReader extends Terms { final OrdsBlockTreeTermsReader parent; final FST index; + // private boolean DEBUG; OrdsFieldReader( diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/BlockReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/BlockReader.java index 927b3aafc1d..4358eafdf20 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/BlockReader.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/BlockReader.java @@ -62,8 +62,10 @@ public class BlockReader extends BaseTermsEnum implements Accountable { protected BlockHeader.Serializer blockHeaderReader; protected BlockLine.Serializer blockLineReader; + /** In-memory read buffer for the current block. */ protected ByteArrayDataInput blockReadBuffer; + /** * In-memory read buffer for the details region of the current block. It shares the same byte * array as {@link #blockReadBuffer}, with a different position. @@ -74,6 +76,7 @@ public class BlockReader extends BaseTermsEnum implements Accountable { /** {@link IndexDictionary.Browser} supplier for lazy loading. */ protected final IndexDictionary.BrowserSupplier dictionaryBrowserSupplier; + /** Holds the {@link IndexDictionary.Browser} once loaded. */ protected IndexDictionary.Browser dictionaryBrowser; @@ -82,19 +85,25 @@ public class BlockReader extends BaseTermsEnum implements Accountable { * UniformSplitPostingsFormat#TERMS_BLOCKS_EXTENSION block file}. */ protected long blockStartFP; + /** Current block header. */ protected BlockHeader blockHeader; + /** Current block line. */ protected BlockLine blockLine; + /** Current block line details. */ protected BlockTermState termState; + /** * Offset of the start of the first line of the current block (just after the header), relative to * the block start. */ protected int blockFirstLineStart; + /** Current line index in the block. */ protected int lineIndexInBlock; + /** * Whether the current {@link TermState} has been forced with a call to {@link * #seekExact(BytesRef, TermState)}. @@ -102,6 +111,7 @@ public class BlockReader extends BaseTermsEnum implements Accountable { * @see #forcedTerm */ protected boolean termStateForced; + /** * Set when {@link #seekExact(BytesRef, TermState)} is called. * diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/IntersectBlockReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/IntersectBlockReader.java index dbf3bad6044..3de978c8f69 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/IntersectBlockReader.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/IntersectBlockReader.java @@ -81,15 +81,19 @@ public class IntersectBlockReader extends BlockReader { /** Set this when our current mode is seeking to this term. Set to null after. */ protected BytesRef seekTerm; + /** Number of bytes accepted by the automaton when validating the current term. */ protected int numMatchedBytes; + /** * Automaton states reached when validating the current term, from 0 to {@link #numMatchedBytes} - * 1. */ protected int[] states; + /** Block iteration order determined when scanning the terms in the current block. */ protected BlockIteration blockIteration; + /** * Counter of the number of consecutively rejected terms. Depending on {@link * #NUM_CONSECUTIVELY_REJECTED_TERMS_THRESHOLD}, this may trigger a jump to a block away. diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitPostingsFormat.java index d89d64f5e68..5ac38e78b8f 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitPostingsFormat.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitPostingsFormat.java @@ -39,6 +39,7 @@ public class UniformSplitPostingsFormat extends PostingsFormat { /** Extension of the file containing the terms dictionary (the FST "trie"). */ public static final String TERMS_DICTIONARY_EXTENSION = "ustd"; + /** Extension of the file containing the terms blocks for each field and the fields metadata. */ public static final String TERMS_BLOCKS_EXTENSION = "ustb"; diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitTermsWriter.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitTermsWriter.java index f589b3ce7e5..fe65ae73c9b 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitTermsWriter.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitTermsWriter.java @@ -100,11 +100,13 @@ public class UniformSplitTermsWriter extends FieldsConsumer { /** Default value for the target block size (number of terms per block). */ public static final int DEFAULT_TARGET_NUM_BLOCK_LINES = 32; + /** * Default value for the maximum allowed delta variation of the block size (delta of the number of * terms per block). The block size will be [target block size]+-[allowed delta]. */ public static final int DEFAULT_DELTA_NUM_LINES = (int) (DEFAULT_TARGET_NUM_BLOCK_LINES * 0.1); + /** Upper limit of the block size (maximum number of terms per block). */ protected static final int MAX_NUM_BLOCK_LINES = 1_000; diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitPostingsFormat.java index db93be4f0c3..a966bf6dcb8 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitPostingsFormat.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitPostingsFormat.java @@ -44,6 +44,7 @@ public class STUniformSplitPostingsFormat extends UniformSplitPostingsFormat { /** Extension of the file containing the terms dictionary (the FST "trie"). */ public static final String TERMS_DICTIONARY_EXTENSION = "stustd"; + /** Extension of the file containing the terms blocks for each field and the fields metadata. */ public static final String TERMS_BLOCKS_EXTENSION = "stustb"; diff --git a/lucene/core/src/generated/checksums/generateForUtil.json b/lucene/core/src/generated/checksums/generateForUtil.json index bbc17c7d26e..6cd91640bd1 100644 --- a/lucene/core/src/generated/checksums/generateForUtil.json +++ b/lucene/core/src/generated/checksums/generateForUtil.json @@ -1,4 +1,4 @@ { - "lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java": "f2091e2b7284b70c740052a9b0ee389e67eb48a9", - "lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py": "7a137c58f88d68247be4368122780fa9cc8dce3e" + "lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java": "a67f47001bad680d75c57a864a1552a78fc85600", + "lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py": "3219c6d0289cc64d80dbdbc5db4bd05b8774e797" } \ No newline at end of file diff --git a/lucene/core/src/java/module-info.java b/lucene/core/src/java/module-info.java index f5d8cd275b7..c728be82099 100644 --- a/lucene/core/src/java/module-info.java +++ b/lucene/core/src/java/module-info.java @@ -57,6 +57,7 @@ module org.apache.lucene.core { // Only export internal packages to the test framework. exports org.apache.lucene.internal.tests to org.apache.lucene.test_framework; + // Open certain packages for the test framework (ram usage tester). opens org.apache.lucene.document to org.apache.lucene.test_framework; diff --git a/lucene/core/src/java/org/apache/lucene/analysis/AbstractAnalysisFactory.java b/lucene/core/src/java/org/apache/lucene/analysis/AbstractAnalysisFactory.java index 320677edeff..53a456aeaea 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/AbstractAnalysisFactory.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/AbstractAnalysisFactory.java @@ -59,6 +59,7 @@ public abstract class AbstractAnalysisFactory { /** the luceneVersion arg */ protected final Version luceneMatchVersion; + /** whether the luceneMatchVersion arg is explicitly specified in the serialized schema */ private boolean isExplicitLuceneMatchVersion = false; diff --git a/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java b/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java index 183f9081e30..89fc28c7957 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/Analyzer.java @@ -345,6 +345,7 @@ public abstract class Analyzer implements Closeable { public static final class TokenStreamComponents { /** Original source of the tokens. */ protected final Consumer source; + /** * Sink tokenstream, such as the outer tokenfilter decorating the chain. This can be the source * if there are no filters. diff --git a/lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java b/lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java index 9cd7fbcc21a..3885894b2cf 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java @@ -41,18 +41,25 @@ public final class StandardTokenizer extends Tokenizer { /** Alpha/numeric token type */ public static final int ALPHANUM = 0; + /** Numeric token type */ public static final int NUM = 1; + /** Southeast Asian token type */ public static final int SOUTHEAST_ASIAN = 2; + /** Ideographic token type */ public static final int IDEOGRAPHIC = 3; + /** Hiragana token type */ public static final int HIRAGANA = 4; + /** Katakana token type */ public static final int KATAKANA = 5; + /** Hangul token type */ public static final int HANGUL = 6; + /** Emoji token type. */ public static final int EMOJI = 7; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/BlockTermState.java b/lucene/core/src/java/org/apache/lucene/codecs/BlockTermState.java index 06508e72d3b..f8b7091b8e1 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/BlockTermState.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/BlockTermState.java @@ -28,11 +28,13 @@ import org.apache.lucene.index.TermState; public class BlockTermState extends OrdTermState { /** how many docs have this term */ public int docFreq; + /** total number of occurrences of this term */ public long totalTermFreq; /** the term's ord in the current block */ public int termBlockOrd; + /** fp into the terms dict primary file (_X.tim) that holds this term */ // TODO: update BTR to nuke this public long blockFilePointer; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java index cb4fac454c8..525381d60c9 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java @@ -44,6 +44,7 @@ public final class CodecUtil { /** Constant to identify the start of a codec header. */ public static final int CODEC_MAGIC = 0x3fd76c17; + /** Constant to identify the start of a codec footer. */ public static final int FOOTER_MAGIC = ~CODEC_MAGIC; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java index a4de8c525ef..a58c84e314b 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java @@ -269,6 +269,7 @@ final class ForUtil { MASKS32[i] = mask32(i); } } + // mark values in array as final longs to avoid the cost of reading array, arrays should only be // used when the idx is a variable private static final long MASK8_1 = MASKS8[1]; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90CompoundFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90CompoundFormat.java index b486a6536cc..9851b0326bf 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90CompoundFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90CompoundFormat.java @@ -69,6 +69,7 @@ public final class Lucene90CompoundFormat extends CompoundFormat { /** Extension of compound file */ static final String DATA_EXTENSION = "cfs"; + /** Extension of compound file entries */ static final String ENTRIES_EXTENSION = "cfe"; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsFormat.java index f30b2688bb1..de0d9c381a8 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsFormat.java @@ -443,15 +443,19 @@ public final class Lucene90PostingsFormat extends PostingsFormat { public static final class IntBlockTermState extends BlockTermState { /** file pointer to the start of the doc ids enumeration, in {@link #DOC_EXTENSION} file */ public long docStartFP; + /** file pointer to the start of the positions enumeration, in {@link #POS_EXTENSION} file */ public long posStartFP; + /** file pointer to the start of the payloads enumeration, in {@link #PAY_EXTENSION} file */ public long payStartFP; + /** * file offset for the start of the skip list, relative to docStartFP, if there are more than * {@link ForUtil#BLOCK_SIZE} docs; otherwise -1 */ public long skipOffset; + /** * file offset for the last position in the last block, if there are more than {@link * ForUtil#BLOCK_SIZE} positions; otherwise -1 @@ -463,6 +467,7 @@ public final class Lucene90PostingsFormat extends PostingsFormat { * positions to skip for that block, without telling us how many positions it has skipped. */ public long lastPosBlockOffset; + /** * docid when there is a single pulsed posting, otherwise -1. freq is always implicitly * totalTermFreq in this case. diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/FieldReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/FieldReader.java index 39caaeb622d..2bbcc9541ed 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/FieldReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/FieldReader.java @@ -53,6 +53,7 @@ public final class FieldReader extends Terms { final Lucene90BlockTreeTermsReader parent; final FST index; + // private boolean DEBUG; FieldReader( diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsWriter.java index 1b518868169..0356a1fa448 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsWriter.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsWriter.java @@ -57,10 +57,13 @@ public final class Lucene90CompressingStoredFieldsWriter extends StoredFieldsWri /** Extension of stored fields file */ public static final String FIELDS_EXTENSION = "fdt"; + /** Extension of stored fields index */ public static final String INDEX_EXTENSION = "fdx"; + /** Extension of stored fields meta */ public static final String META_EXTENSION = "fdm"; + /** Codec name for the index. */ public static final String INDEX_CODEC_NAME = "Lucene90FieldsIndex"; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py index c73acc7ead5..a468c590cf9 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fractions import gcd +from math import gcd """Code generation for ForUtil.java""" diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsFormat.java index f1594b3068c..d90e56dbdfc 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsFormat.java @@ -115,6 +115,7 @@ public final class Lucene95HnswVectorsFormat extends KnnVectorsFormat { * numbers here will use an inordinate amount of heap */ private static final int MAXIMUM_MAX_CONN = 512; + /** Default number of maximum connections per node */ public static final int DEFAULT_MAX_CONN = 16; @@ -124,6 +125,7 @@ public final class Lucene95HnswVectorsFormat extends KnnVectorsFormat { * 3200` */ private static final int MAXIMUM_BEAM_WIDTH = 3200; + /** * Default number of the size of the queue maintained while searching during a graph construction. */ diff --git a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java index 515e68aa29c..f86bd3bad35 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java @@ -83,6 +83,7 @@ public abstract class PerFieldPostingsFormat extends PostingsFormat { static class FieldsGroup { final List fields; final int suffix; + /** * Custom SegmentWriteState for this group of fields, with the segmentSuffix uniqueified for * this PostingsFormat diff --git a/lucene/core/src/java/org/apache/lucene/document/InetAddressPoint.java b/lucene/core/src/java/org/apache/lucene/document/InetAddressPoint.java index a304dcf8bf5..dcfd65a8a08 100644 --- a/lucene/core/src/java/org/apache/lucene/document/InetAddressPoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/InetAddressPoint.java @@ -70,6 +70,7 @@ public class InetAddressPoint extends Field { /** The minimum value that an ip address can hold. */ public static final InetAddress MIN_VALUE; + /** The maximum value that an ip address can hold. */ public static final InetAddress MAX_VALUE; diff --git a/lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java b/lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java index c459b080363..0c2979b4c9f 100644 --- a/lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java @@ -91,6 +91,7 @@ import org.apache.lucene.util.SloppyMath; public class LatLonPoint extends Field { /** LatLonPoint is encoded as integer values so number of bytes is 4 */ public static final int BYTES = Integer.BYTES; + /** * Type for an indexed LatLonPoint * diff --git a/lucene/core/src/java/org/apache/lucene/document/LongHashSet.java b/lucene/core/src/java/org/apache/lucene/document/LongHashSet.java index b72f2b3834c..5234193b047 100644 --- a/lucene/core/src/java/org/apache/lucene/document/LongHashSet.java +++ b/lucene/core/src/java/org/apache/lucene/document/LongHashSet.java @@ -35,8 +35,10 @@ final class LongHashSet implements Accountable { final int mask; final boolean hasMissingValue; final int size; + /** minimum value in the set, or Long.MAX_VALUE for an empty set */ final long minValue; + /** maximum value in the set, or Long.MIN_VALUE for an empty set */ final long maxValue; diff --git a/lucene/core/src/java/org/apache/lucene/document/RangeFieldQuery.java b/lucene/core/src/java/org/apache/lucene/document/RangeFieldQuery.java index a7bcd5834a9..b9e97833b74 100644 --- a/lucene/core/src/java/org/apache/lucene/document/RangeFieldQuery.java +++ b/lucene/core/src/java/org/apache/lucene/document/RangeFieldQuery.java @@ -47,17 +47,22 @@ import org.apache.lucene.util.DocIdSetBuilder; public abstract class RangeFieldQuery extends Query { /** field name */ final String field; + /** * query relation intersects: {@code CELL_CROSSES_QUERY}, contains: {@code CELL_CONTAINS_QUERY}, * within: {@code CELL_WITHIN_QUERY} */ final QueryType queryType; + /** number of dimensions - max 4 */ final int numDims; + /** ranges encoded as a sortable byte array */ final byte[] ranges; + /** number of bytes per dimension */ final int bytesPerDim; + /** ByteArrayComparator selected by bytesPerDim */ final ByteArrayComparator comparator; diff --git a/lucene/core/src/java/org/apache/lucene/document/ShapeDocValues.java b/lucene/core/src/java/org/apache/lucene/document/ShapeDocValues.java index 6756f370d64..a30675a3364 100644 --- a/lucene/core/src/java/org/apache/lucene/document/ShapeDocValues.java +++ b/lucene/core/src/java/org/apache/lucene/document/ShapeDocValues.java @@ -51,12 +51,16 @@ import org.apache.lucene.util.BytesRef; abstract class ShapeDocValues { /** doc value format version; used to support bwc for any encoding changes */ protected static final byte VERSION = 0; + /** the binary doc value */ private final BytesRef data; + /** the geometry comparator used to check relations */ protected final ShapeComparator shapeComparator; + /** the centroid of the shape docvalue */ protected final Geometry centroid; + /** the bounding box of the shape docvalue */ protected final Geometry boundingBox; diff --git a/lucene/core/src/java/org/apache/lucene/document/ShapeField.java b/lucene/core/src/java/org/apache/lucene/document/ShapeField.java index 804e7f11be8..08e461bf1d7 100644 --- a/lucene/core/src/java/org/apache/lucene/document/ShapeField.java +++ b/lucene/core/src/java/org/apache/lucene/document/ShapeField.java @@ -412,24 +412,34 @@ public final class ShapeField { /** all coordinates are different */ TRIANGLE } + /** x coordinate, vertex one */ public int aX; + /** y coordinate, vertex one */ public int aY; + /** x coordinate, vertex two */ public int bX; + /** y coordinate, vertex two */ public int bY; + /** x coordinate, vertex three */ public int cX; + /** y coordinate, vertex three */ public int cY; + /** represent if edge ab belongs to original shape */ public boolean ab; + /** represent if edge bc belongs to original shape */ public boolean bc; + /** represent if edge ca belongs to original shape */ public boolean ca; + /** triangle type */ public TYPE type; diff --git a/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java b/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java index 612c1e0c16d..d7c100776b3 100644 --- a/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java +++ b/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java @@ -59,6 +59,7 @@ import org.apache.lucene.util.FixedBitSet; abstract class SpatialQuery extends Query { /** field name */ final String field; + /** * query relation disjoint: {@link QueryRelation#DISJOINT}, intersects: {@link * QueryRelation#INTERSECTS}, within: {@link QueryRelation#DISJOINT}, contains: {@link diff --git a/lucene/core/src/java/org/apache/lucene/document/XYPointField.java b/lucene/core/src/java/org/apache/lucene/document/XYPointField.java index 545125de1c8..8e891b54e70 100644 --- a/lucene/core/src/java/org/apache/lucene/document/XYPointField.java +++ b/lucene/core/src/java/org/apache/lucene/document/XYPointField.java @@ -55,6 +55,7 @@ import org.apache.lucene.util.NumericUtils; public class XYPointField extends Field { /** XYPoint is encoded as integer values so number of bytes is 4 */ public static final int BYTES = Integer.BYTES; + /** * Type for an indexed XYPoint * diff --git a/lucene/core/src/java/org/apache/lucene/geo/Circle.java b/lucene/core/src/java/org/apache/lucene/geo/Circle.java index 78dc929bb35..ad01b359dba 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Circle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Circle.java @@ -33,8 +33,10 @@ package org.apache.lucene.geo; public final class Circle extends LatLonGeometry { /** Center latitude */ private final double lat; + /** Center longitude */ private final double lon; + /** radius in meters */ private final double radiusMeters; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Circle2D.java b/lucene/core/src/java/org/apache/lucene/geo/Circle2D.java index 7029ba33d37..d42db3b536f 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Circle2D.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Circle2D.java @@ -259,24 +259,34 @@ class Circle2D implements Component2D { /** check if the point is within a distance */ boolean contains(double x, double y); + /** check if the line is within a distance */ boolean intersectsLine(double aX, double aY, double bX, double bY); + /** Relates this calculator to the provided bounding box */ Relation relate(double minX, double maxX, double minY, double maxY); + /** check if the bounding box is disjoint with this calculator bounding box */ boolean disjoint(double minX, double maxX, double minY, double maxY); + /** check if the bounding box is contains this calculator bounding box */ boolean within(double minX, double maxX, double minY, double maxY); + /** get min X of this calculator */ double getMinX(); + /** get max X of this calculator */ double getMaxX(); + /** get min Y of this calculator */ double getMinY(); + /** get max Y of this calculator */ double getMaxY(); + /** get center X */ double geX(); + /** get center Y */ double getY(); } diff --git a/lucene/core/src/java/org/apache/lucene/geo/ComponentTree.java b/lucene/core/src/java/org/apache/lucene/geo/ComponentTree.java index bca0040954f..bb54bd65c23 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/ComponentTree.java +++ b/lucene/core/src/java/org/apache/lucene/geo/ComponentTree.java @@ -28,20 +28,26 @@ import org.apache.lucene.util.ArrayUtil; final class ComponentTree implements Component2D { /** minimum Y of this geometry's bounding box area */ private double minY; + /** maximum Y of this geometry's bounding box area */ private double maxY; + /** minimum X of this geometry's bounding box area */ private double minX; + /** maximum X of this geometry's bounding box area */ private double maxX; + // child components, or null. Note internal nodes might mot have // a consistent bounding box. Internal nodes should not be accessed // outside if this class. private Component2D left; private Component2D right; + /** which dimension was this node split on */ // TODO: its implicit based on level, but boolean keeps code simple private final boolean splitX; + /** root node of edge tree */ private final Component2D component; diff --git a/lucene/core/src/java/org/apache/lucene/geo/EdgeTree.java b/lucene/core/src/java/org/apache/lucene/geo/EdgeTree.java index 84e405499d8..c77047f4f9c 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/EdgeTree.java +++ b/lucene/core/src/java/org/apache/lucene/geo/EdgeTree.java @@ -34,14 +34,19 @@ final class EdgeTree { // X-Y pair (in original order) of the two vertices final double y1, y2; final double x1, x2; + /** min Y of this edge */ final double low; + /** max Y of this edge or any children */ double max; + /** left child edge, or null */ EdgeTree left; + /** right child edge, or null */ EdgeTree right; + /** helper bytes to signal if a point is on an edge, it is within the edge tree or disjoint */ private static final byte FALSE = 0x00; diff --git a/lucene/core/src/java/org/apache/lucene/geo/GeoUtils.java b/lucene/core/src/java/org/apache/lucene/geo/GeoUtils.java index 5542b3d13b9..825961ffa1b 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/GeoUtils.java +++ b/lucene/core/src/java/org/apache/lucene/geo/GeoUtils.java @@ -43,10 +43,13 @@ public final class GeoUtils { /** min longitude value in radians */ public static final double MIN_LON_RADIANS = Math.toRadians(MIN_LON_INCL); + /** min latitude value in radians */ public static final double MIN_LAT_RADIANS = Math.toRadians(MIN_LAT_INCL); + /** max longitude value in radians */ public static final double MAX_LON_RADIANS = Math.toRadians(MAX_LON_INCL); + /** max latitude value in radians */ public static final double MAX_LAT_RADIANS = Math.toRadians(MAX_LAT_INCL); diff --git a/lucene/core/src/java/org/apache/lucene/geo/Line.java b/lucene/core/src/java/org/apache/lucene/geo/Line.java index c88511f8b3b..0cf6662883f 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Line.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Line.java @@ -33,15 +33,19 @@ import java.util.Arrays; public class Line extends LatLonGeometry { /** array of latitude coordinates */ private final double[] lats; + /** array of longitude coordinates */ private final double[] lons; /** minimum latitude of this line's bounding box */ public final double minLat; + /** maximum latitude of this line's bounding box */ public final double maxLat; + /** minimum longitude of this line's bounding box */ public final double minLon; + /** maximum longitude of this line's bounding box */ public final double maxLon; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Line2D.java b/lucene/core/src/java/org/apache/lucene/geo/Line2D.java index 351afb30d1b..81ace92663c 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Line2D.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Line2D.java @@ -29,12 +29,16 @@ final class Line2D implements Component2D { /** minimum Y of this geometry's bounding box area */ private final double minY; + /** maximum Y of this geometry's bounding box area */ private final double maxY; + /** minimum X of this geometry's bounding box area */ private final double minX; + /** maximum X of this geometry's bounding box area */ private final double maxX; + /** lines represented as a 2-d interval tree. */ private final EdgeTree tree; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Point.java b/lucene/core/src/java/org/apache/lucene/geo/Point.java index f4811ef09d9..938517a2d48 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Point.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Point.java @@ -33,6 +33,7 @@ public final class Point extends LatLonGeometry { /** latitude coordinate */ private final double lat; + /** longitude coordinate */ private final double lon; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java index 2891d6992fa..cd9dd14d7ad 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java @@ -47,12 +47,16 @@ public final class Polygon extends LatLonGeometry { /** minimum latitude of this polygon's bounding box area */ public final double minLat; + /** maximum latitude of this polygon's bounding box area */ public final double maxLat; + /** minimum longitude of this polygon's bounding box area */ public final double minLon; + /** maximum longitude of this polygon's bounding box area */ public final double maxLon; + /** winding order of the vertices */ private final WindingOrder windingOrder; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Polygon2D.java b/lucene/core/src/java/org/apache/lucene/geo/Polygon2D.java index 01ae8523f1b..d42459a0fdd 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Polygon2D.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Polygon2D.java @@ -28,14 +28,19 @@ import org.apache.lucene.index.PointValues.Relation; final class Polygon2D implements Component2D { /** minimum Y of this geometry's bounding box area */ private final double minY; + /** maximum Y of this geometry's bounding box area */ private final double maxY; + /** minimum X of this geometry's bounding box area */ private final double minX; + /** maximum X of this geometry's bounding box area */ private final double maxX; + /** tree of holes, or null */ protected final Component2D holes; + /** Edges of the polygon represented as a 2-d interval tree. */ final EdgeTree tree; diff --git a/lucene/core/src/java/org/apache/lucene/geo/Rectangle.java b/lucene/core/src/java/org/apache/lucene/geo/Rectangle.java index c92496b1340..e5406b5d3db 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Rectangle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Rectangle.java @@ -36,10 +36,13 @@ import static org.apache.lucene.util.SloppyMath.cos; public class Rectangle extends LatLonGeometry { /** maximum longitude value (in degrees) */ public final double minLat; + /** minimum longitude value (in degrees) */ public final double minLon; + /** maximum latitude value (in degrees) */ public final double maxLat; + /** minimum latitude value (in degrees) */ public final double maxLon; diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java b/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java index 72b65186b16..aea05e4aa59 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java @@ -33,8 +33,10 @@ import static org.apache.lucene.geo.XYEncodingUtils.checkVal; public final class XYCircle extends XYGeometry { /** Center x */ private final float x; + /** Center y */ private final float y; + /** radius */ private final float radius; diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYLine.java b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java index 130c377cd6e..513a779ed15 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYLine.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java @@ -27,15 +27,19 @@ import java.util.Arrays; public class XYLine extends XYGeometry { /** array of x coordinates */ private final float[] x; + /** array of y coordinates */ private final float[] y; /** minimum x of this line's bounding box */ public final float minX; + /** maximum y of this line's bounding box */ public final float maxX; + /** minimum y of this line's bounding box */ public final float minY; + /** maximum y of this line's bounding box */ public final float maxY; diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java b/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java index 5cd95c4a43a..e2afddb8ef6 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java @@ -35,6 +35,7 @@ public final class XYPoint extends XYGeometry { /** latitude coordinate */ private final float x; + /** longitude coordinate */ private final float y; diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java index fcadb6bc41f..1b3bbb72234 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java @@ -31,12 +31,16 @@ public final class XYPolygon extends XYGeometry { /** minimum x of this polygon's bounding box area */ public final float minX; + /** maximum x of this polygon's bounding box area */ public final float maxX; + /** minimum y of this polygon's bounding box area */ public final float minY; + /** maximum y of this polygon's bounding box area */ public final float maxY; + /** winding order of the vertices */ private final GeoUtils.WindingOrder windingOrder; diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java b/lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java index a06dffd48cf..ecf68b6f6f6 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYRectangle.java @@ -22,10 +22,13 @@ import static org.apache.lucene.geo.XYEncodingUtils.checkVal; public final class XYRectangle extends XYGeometry { /** minimum x value */ public final float minX; + /** minimum y value */ public final float maxX; + /** maximum x value */ public final float minY; + /** maximum y value */ public final float maxY; diff --git a/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java b/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java index 6c091b36766..e4e308a374e 100644 --- a/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java @@ -47,6 +47,7 @@ import java.util.concurrent.atomic.AtomicInteger; */ public abstract class BaseCompositeReader extends CompositeReader { private final R[] subReaders; + /** A comparator for sorting sub-readers */ protected final Comparator subReadersSorter; diff --git a/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java b/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java index 70d6ccc91e8..96da8625c44 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java +++ b/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java @@ -115,6 +115,7 @@ abstract class DocValuesFieldUpdates implements Accountable { } }; } + /** Wraps the given iterator as a NumericDocValues instance. */ static NumericDocValues asNumericDocValues(Iterator iterator) { return new NumericDocValues() { diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java b/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java index 4b2d917b21a..59184a6bff0 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java +++ b/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java @@ -28,6 +28,7 @@ import java.util.Objects; public final class FieldInfo { /** Field's name */ public final String name; + /** Internal field number */ public final int number; diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java b/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java index 0f1ef3439bf..5190f35c93e 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java +++ b/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java @@ -271,16 +271,22 @@ final class FieldUpdatesBuffer { private BufferedUpdate() {} ; + /** the max document ID this update should be applied to */ int docUpTo; + /** a numeric value or 0 if this buffer holds binary updates */ long numericValue; + /** a binary value or null if this buffer holds numeric updates */ BytesRef binaryValue; + /** true if this update has a value */ boolean hasValue; + /** The update terms field. This will never be null. */ String termField; + /** The update terms value. This will never be null. */ BytesRef termValue; diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterCodecReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterCodecReader.java index e2a60291ab8..737aedce204 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FilterCodecReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/FilterCodecReader.java @@ -47,6 +47,7 @@ public abstract class FilterCodecReader extends CodecReader { } return reader; } + /** The underlying CodecReader instance. */ protected final CodecReader in; diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java b/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java index a23d5015ff2..167900575af 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java @@ -25,13 +25,16 @@ import java.util.List; public abstract sealed class IndexReaderContext permits CompositeReaderContext, LeafReaderContext { /** The reader context for this reader's immediate parent, or null if none */ public final CompositeReaderContext parent; + /** * {@code true} if this context struct represents the top level reader within the hierarchical * context */ public final boolean isTopLevel; + /** the doc base for this reader in the parent, {@code 0} if parent is null */ public final int docBaseInParent; + /** the ord for this reader in the parent, {@code 0} if parent is null */ public final int ordInParent; diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index b562f7740d2..3fbf35097c1 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -230,10 +230,13 @@ public class IndexWriter /** Key for the source of a segment in the {@link SegmentInfo#getDiagnostics() diagnostics}. */ public static final String SOURCE = "source"; + /** Source of a segment which results from a merge of other segments. */ public static final String SOURCE_MERGE = "merge"; + /** Source of a segment which results from a flush. */ public static final String SOURCE_FLUSH = "flush"; + /** Source of a segment which results from a call to {@link #addIndexes(CodecReader...)}. */ public static final String SOURCE_ADDINDEXES_READERS = "addIndexes(CodecReader...)"; @@ -5779,6 +5782,7 @@ public class IndexWriter private synchronized void deleteNewFiles(Collection files) throws IOException { deleter.deleteNewFiles(files); } + /** Cleans up residuals from a segment that could not be entirely flushed due to an error */ private synchronized void flushFailed(SegmentInfo info) throws IOException { // TODO: this really should be a tragic diff --git a/lucene/core/src/java/org/apache/lucene/index/LeafReaderContext.java b/lucene/core/src/java/org/apache/lucene/index/LeafReaderContext.java index 9bb7bd2e5d9..a6ff76d6f11 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LeafReaderContext.java +++ b/lucene/core/src/java/org/apache/lucene/index/LeafReaderContext.java @@ -23,6 +23,7 @@ import java.util.List; public final class LeafReaderContext extends IndexReaderContext { /** The reader's ord in the top-level's leaves array */ public final int ord; + /** The reader's absolute doc base */ public final int docBase; diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java index c33e6e3d6cf..1a42afe8068 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java @@ -684,8 +684,10 @@ public class MultiDocValues { public static class MultiSortedDocValues extends SortedDocValues { /** docbase for each leaf: parallel with {@link #values} */ public final int[] docStarts; + /** leaf values */ public final SortedDocValues[] values; + /** ordinal map mapping ords from values to global ord space */ public final OrdinalMap mapping; @@ -821,8 +823,10 @@ public class MultiDocValues { public static class MultiSortedSetDocValues extends SortedSetDocValues { /** docbase for each leaf: parallel with {@link #values} */ public final int[] docStarts; + /** leaf values */ public final SortedSetDocValues[] values; + /** ordinal map mapping ords from values to global ord space */ public final OrdinalMap mapping; diff --git a/lucene/core/src/java/org/apache/lucene/index/OrdinalMap.java b/lucene/core/src/java/org/apache/lucene/index/OrdinalMap.java index 3218e228734..04b83a811f2 100644 --- a/lucene/core/src/java/org/apache/lucene/index/OrdinalMap.java +++ b/lucene/core/src/java/org/apache/lucene/index/OrdinalMap.java @@ -187,6 +187,7 @@ public class OrdinalMap implements Accountable { /** Cache key of whoever asked for this awful thing */ public final IndexReader.CacheKey owner; + // number of global ordinals final long valueCount; // globalOrd -> (globalOrd - segmentOrd) where segmentOrd is the ordinal in the first segment diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentCoreReaders.java b/lucene/core/src/java/org/apache/lucene/index/SegmentCoreReaders.java index 9e0cdc86f92..68970de6d1b 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentCoreReaders.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentCoreReaders.java @@ -61,6 +61,7 @@ final class SegmentCoreReaders { final KnnVectorsReader knnVectorsReader; final CompoundDirectory cfsReader; final String segment; + /** * fieldinfos for this core: means gen=-1. this is the exact fieldinfos these codec components saw * at write. in the case of DV updates, SR may hold a newer version. diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java index d2cb1abaa8a..ad9f31650ed 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java @@ -115,6 +115,7 @@ public final class SegmentInfos implements Cloneable, Iterable retentionQuerySupplier; + /** * Creates a new {@link SoftDeletesRetentionMergePolicy} * diff --git a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java index 304bbdd2e57..208aa297287 100644 --- a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java @@ -113,6 +113,7 @@ public class TieredMergePolicy extends MergePolicy { FORCE_MERGE, FORCE_MERGE_DELETES } + /** * Returns the current maxMergeAtOnce setting. * diff --git a/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java b/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java index 093dd0f53f9..77e6b35b47a 100644 --- a/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java @@ -48,6 +48,7 @@ public class AutomatonQuery extends MultiTermQuery implements Accountable { protected final Automaton automaton; protected final CompiledAutomaton compiled; + /** term containing the field, and possibly some pattern structure */ protected final Term term; diff --git a/lucene/core/src/java/org/apache/lucene/search/BoostAttribute.java b/lucene/core/src/java/org/apache/lucene/search/BoostAttribute.java index 0a1570e2edf..fe4e45184e7 100644 --- a/lucene/core/src/java/org/apache/lucene/search/BoostAttribute.java +++ b/lucene/core/src/java/org/apache/lucene/search/BoostAttribute.java @@ -35,8 +35,10 @@ import org.apache.lucene.util.AttributeSource; // javadocs only */ public interface BoostAttribute extends Attribute { float DEFAULT_BOOST = 1.0f; + /** Sets the boost in this attribute */ public void setBoost(float boost); + /** Retrieves the boost, default is {@code 1.0f}. */ public float getBoost(); } diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java index 723ec037c67..ff53dbb0d81 100644 --- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java +++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java @@ -92,6 +92,7 @@ public class IndexSearcher { final long maxRamBytesUsed = Math.min(1L << 25, Runtime.getRuntime().maxMemory() / 20); DEFAULT_QUERY_CACHE = new LRUQueryCache(maxCachedQueries, maxRamBytesUsed); } + /** * By default we count hits accurately up to 1000. This makes sure that we don't spend most time * on computing hit counts @@ -968,6 +969,7 @@ public class IndexSearcher { public TooManyClauses() { this("maxClauseCount is set to " + IndexSearcher.getMaxClauseCount()); } + /** The value of {@link IndexSearcher#getMaxClauseCount()} when this Exception was created */ public int getMaxClauseCount() { return maxClauseCount; diff --git a/lucene/core/src/java/org/apache/lucene/search/MaxNonCompetitiveBoostAttribute.java b/lucene/core/src/java/org/apache/lucene/search/MaxNonCompetitiveBoostAttribute.java index 65b157f3d53..2e15cc48dc2 100644 --- a/lucene/core/src/java/org/apache/lucene/search/MaxNonCompetitiveBoostAttribute.java +++ b/lucene/core/src/java/org/apache/lucene/search/MaxNonCompetitiveBoostAttribute.java @@ -37,13 +37,16 @@ import org.apache.lucene.util.BytesRef; public interface MaxNonCompetitiveBoostAttribute extends Attribute { /** This is the maximum boost that would not be competitive. */ public void setMaxNonCompetitiveBoost(float maxNonCompetitiveBoost); + /** * This is the maximum boost that would not be competitive. Default is negative infinity, which * means every term is competitive. */ public float getMaxNonCompetitiveBoost(); + /** This is the term or null of the term that triggered the boost change. */ public void setCompetitiveTerm(BytesRef competitiveTerm); + /** * This is the term or null of the term that triggered the boost change. Default is * null, which means every term is competitoive. diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java index 23cd178bfed..4607487b370 100644 --- a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java @@ -417,13 +417,16 @@ public class MultiPhraseQuery extends Query { public static class UnionPostingsEnum extends PostingsEnum { /** queue ordered by docid */ final DocsQueue docsQueue; + /** cost of this enum: sum of its subs */ final long cost; /** queue ordered by position for current doc */ final PositionsQueue posQueue = new PositionsQueue(); + /** current doc posQueue is working */ int posQueueDoc = -2; + /** list of subs (unordered) */ final PostingsEnum[] subs; diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiTermQuery.java b/lucene/core/src/java/org/apache/lucene/search/MultiTermQuery.java index 0d3f487d2c4..5a56286ebed 100644 --- a/lucene/core/src/java/org/apache/lucene/search/MultiTermQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/MultiTermQuery.java @@ -57,6 +57,7 @@ public abstract class MultiTermQuery extends Query { public abstract static class RewriteMethod { public abstract Query rewrite(IndexSearcher indexSearcher, MultiTermQuery query) throws IOException; + /** * Returns the {@link MultiTermQuery}s {@link TermsEnum} * diff --git a/lucene/core/src/java/org/apache/lucene/search/Scorable.java b/lucene/core/src/java/org/apache/lucene/search/Scorable.java index db53eb97e7b..6fd531e7d84 100644 --- a/lucene/core/src/java/org/apache/lucene/search/Scorable.java +++ b/lucene/core/src/java/org/apache/lucene/search/Scorable.java @@ -71,6 +71,7 @@ public abstract class Scorable { public static class ChildScorable { /** Child Scorer. (note this is typically a direct child, and may itself also have children). */ public final Scorable child; + /** An arbitrary string relating this scorer to the parent. */ public final String relationship; diff --git a/lucene/core/src/java/org/apache/lucene/search/TermCollectingRewrite.java b/lucene/core/src/java/org/apache/lucene/search/TermCollectingRewrite.java index 7adbd9f33d2..13da14b9655 100644 --- a/lucene/core/src/java/org/apache/lucene/search/TermCollectingRewrite.java +++ b/lucene/core/src/java/org/apache/lucene/search/TermCollectingRewrite.java @@ -79,6 +79,7 @@ abstract class TermCollectingRewrite extends MultiTermQuery.RewriteMethod { this.readerContext = readerContext; this.topReaderContext = topReaderContext; } + /** attributes used for communication with the enum */ public final AttributeSource attributes = new AttributeSource(); diff --git a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java index c50f3a372e9..23c1a4b4ccb 100644 --- a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java +++ b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java @@ -48,14 +48,17 @@ public class TimeLimitingCollector implements Collector { this.timeElapsed = timeElapsed; this.lastDocCollected = lastDocCollected; } + /** Returns allowed time (milliseconds). */ public long getTimeAllowed() { return timeAllowed; } + /** Returns elapsed time (milliseconds). */ public long getTimeElapsed() { return timeElapsed; } + /** Returns last doc (absolute doc id) that was collected when the search time exceeded. */ public int getLastDocCollected() { return lastDocCollected; diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java index ff26df87c71..f6dacd54c1e 100644 --- a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java @@ -213,16 +213,22 @@ public class BM25Similarity extends Similarity { private static class BM25Scorer extends SimScorer { /** query boost */ private final float boost; + /** k1 value for scale factor */ private final float k1; + /** b value for length normalization impact */ private final float b; + /** BM25's idf */ private final Explanation idf; + /** The average document length. */ private final float avgdl; + /** precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl) */ private final float[] cache; + /** weight (idf * boost) */ private final float weight; diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java b/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java index 36d5b9281aa..9a79a4be265 100644 --- a/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java @@ -25,14 +25,19 @@ import org.apache.lucene.index.Terms; */ public class BasicStats { final String field; + /** The number of documents. */ protected long numberOfDocuments; + /** The total number of tokens in the field. */ protected long numberOfFieldTokens; + /** The average field length. */ protected double avgFieldLength; + /** The document frequency. */ protected long docFreq; + /** The total number of occurrences of this term across all documents. */ protected long totalTermFreq; diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/DFRSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/DFRSimilarity.java index 4e10ea21cd7..f47c05be1f0 100644 --- a/lucene/core/src/java/org/apache/lucene/search/similarities/DFRSimilarity.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/DFRSimilarity.java @@ -75,8 +75,10 @@ import org.apache.lucene.search.similarities.Normalization.NoNormalization; public class DFRSimilarity extends SimilarityBase { /** The basic model for information content. */ protected final BasicModel basicModel; + /** The first normalization of the information content. */ protected final AfterEffect afterEffect; + /** The term frequency normalization. */ protected final Normalization normalization; diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/IBSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/IBSimilarity.java index e6587e5127d..5b0e93571b1 100644 --- a/lucene/core/src/java/org/apache/lucene/search/similarities/IBSimilarity.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/IBSimilarity.java @@ -68,8 +68,10 @@ import org.apache.lucene.search.similarities.Normalization.NoNormalization; public class IBSimilarity extends SimilarityBase { /** The probabilistic distribution used to model term occurrence. */ protected final Distribution distribution; + /** The lambda (λw) parameter. */ protected final Lambda lambda; + /** The term frequency normalization. */ protected final Normalization normalization; diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/Lambda.java b/lucene/core/src/java/org/apache/lucene/search/similarities/Lambda.java index a2ad3d5a3fb..77d5a5f361f 100644 --- a/lucene/core/src/java/org/apache/lucene/search/similarities/Lambda.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/Lambda.java @@ -31,6 +31,7 @@ public abstract class Lambda { /** Computes the lambda parameter. */ public abstract float lambda(BasicStats stats); + /** Explains the lambda parameter. */ public abstract Explanation explain(BasicStats stats); diff --git a/lucene/core/src/java/org/apache/lucene/store/BufferedChecksum.java b/lucene/core/src/java/org/apache/lucene/store/BufferedChecksum.java index 1c1279b5f30..308825687e1 100644 --- a/lucene/core/src/java/org/apache/lucene/store/BufferedChecksum.java +++ b/lucene/core/src/java/org/apache/lucene/store/BufferedChecksum.java @@ -23,6 +23,7 @@ public class BufferedChecksum implements Checksum { private final Checksum in; private final byte[] buffer; private int upto; + /** Default buffer size: 1024 */ public static final int DEFAULT_BUFFERSIZE = 1024; diff --git a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java index 6f6212fc20e..aa729d83c0b 100644 --- a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java +++ b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java @@ -81,11 +81,13 @@ public final class ByteBuffersDataOutput extends DataOutput implements Accountab /** Default {@code minBitsPerBlock} */ public static final int DEFAULT_MIN_BITS_PER_BLOCK = 10; // 1024 B + /** Default {@code maxBitsPerBlock} */ public static final int DEFAULT_MAX_BITS_PER_BLOCK = 26; // 64 MB /** Smallest {@code minBitsPerBlock} allowed */ public static final int LIMIT_MIN_BITS_PER_BLOCK = 1; + /** Largest {@code maxBitsPerBlock} allowed */ public static final int LIMIT_MAX_BITS_PER_BLOCK = 31; diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java index 39a67ffe1c3..246f48082cf 100644 --- a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java @@ -96,10 +96,13 @@ public class NIOFSDirectory extends FSDirectory { /** the file channel we will read from */ protected final FileChannel channel; + /** is this instance a clone and hence does not own the file to close it */ boolean isClone = false; + /** start offset: non-zero in the slice case */ protected final long off; + /** end offset (start+length) */ protected final long end; diff --git a/lucene/core/src/java/org/apache/lucene/store/RandomAccessInput.java b/lucene/core/src/java/org/apache/lucene/store/RandomAccessInput.java index 9c319be3cfa..cdeae8dc1fb 100644 --- a/lucene/core/src/java/org/apache/lucene/store/RandomAccessInput.java +++ b/lucene/core/src/java/org/apache/lucene/store/RandomAccessInput.java @@ -54,6 +54,7 @@ public interface RandomAccessInput { * @see BitUtil#VH_LE_SHORT */ public short readShort(long pos) throws IOException; + /** * Reads an integer (LE byte order) at the given position in the file * @@ -61,6 +62,7 @@ public interface RandomAccessInput { * @see BitUtil#VH_LE_INT */ public int readInt(long pos) throws IOException; + /** * Reads a long (LE byte order) at the given position in the file * diff --git a/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java b/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java index d957e5bf2f9..9f27219659c 100644 --- a/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java +++ b/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java @@ -114,11 +114,13 @@ public final class ByteBlockPool implements Accountable { /** index into the buffers array pointing to the current buffer used as the head */ private int bufferUpto = -1; // Which buffer we are upto + /** Where we are in head buffer */ public int byteUpto = BYTE_BLOCK_SIZE; /** Current head buffer */ public byte[] buffer; + /** Current head offset */ public int byteOffset = -BYTE_BLOCK_SIZE; diff --git a/lucene/core/src/java/org/apache/lucene/util/CharsRef.java b/lucene/core/src/java/org/apache/lucene/util/CharsRef.java index 0cb73ff5597..27a9027c648 100644 --- a/lucene/core/src/java/org/apache/lucene/util/CharsRef.java +++ b/lucene/core/src/java/org/apache/lucene/util/CharsRef.java @@ -29,10 +29,13 @@ import java.util.Objects; public final class CharsRef implements Comparable, CharSequence, Cloneable { /** An empty character array for convenience */ public static final char[] EMPTY_CHARS = new char[0]; + /** The contents of the CharsRef. Should never be {@code null}. */ public char[] chars; + /** Offset of first valid character. */ public int offset; + /** Length of used characters. */ public int length; diff --git a/lucene/core/src/java/org/apache/lucene/util/Constants.java b/lucene/core/src/java/org/apache/lucene/util/Constants.java index d7d33c01482..090472e6736 100644 --- a/lucene/core/src/java/org/apache/lucene/util/Constants.java +++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java @@ -28,14 +28,19 @@ public final class Constants { /** The value of System.getProperty("os.name"). * */ public static final String OS_NAME = System.getProperty("os.name"); + /** True iff running on Linux. */ public static final boolean LINUX = OS_NAME.startsWith("Linux"); + /** True iff running on Windows. */ public static final boolean WINDOWS = OS_NAME.startsWith("Windows"); + /** True iff running on SunOS. */ public static final boolean SUN_OS = OS_NAME.startsWith("SunOS"); + /** True iff running on Mac OS X */ public static final boolean MAC_OS_X = OS_NAME.startsWith("Mac OS X"); + /** True iff running on FreeBSD */ public static final boolean FREE_BSD = OS_NAME.startsWith("FreeBSD"); diff --git a/lucene/core/src/java/org/apache/lucene/util/IntBlockPool.java b/lucene/core/src/java/org/apache/lucene/util/IntBlockPool.java index c0403c8e253..9bd1b9a8c88 100644 --- a/lucene/core/src/java/org/apache/lucene/util/IntBlockPool.java +++ b/lucene/core/src/java/org/apache/lucene/util/IntBlockPool.java @@ -63,10 +63,13 @@ public class IntBlockPool { /** index into the buffers array pointing to the current buffer used as the head */ private int bufferUpto = -1; + /** Pointer to the current position in head buffer */ public int intUpto = INT_BLOCK_SIZE; + /** Current head buffer */ public int[] buffer; + /** Current head offset */ public int intOffset = -INT_BLOCK_SIZE; diff --git a/lucene/core/src/java/org/apache/lucene/util/IntsRef.java b/lucene/core/src/java/org/apache/lucene/util/IntsRef.java index 179aeea7375..52969ca5e5a 100644 --- a/lucene/core/src/java/org/apache/lucene/util/IntsRef.java +++ b/lucene/core/src/java/org/apache/lucene/util/IntsRef.java @@ -30,8 +30,10 @@ public final class IntsRef implements Comparable, Cloneable { /** The contents of the IntsRef. Should never be {@code null}. */ public int[] ints; + /** Offset of first valid integer. */ public int offset; + /** Length of used ints. */ public int length; diff --git a/lucene/core/src/java/org/apache/lucene/util/LongsRef.java b/lucene/core/src/java/org/apache/lucene/util/LongsRef.java index e2940d2b37d..e94f26b480b 100644 --- a/lucene/core/src/java/org/apache/lucene/util/LongsRef.java +++ b/lucene/core/src/java/org/apache/lucene/util/LongsRef.java @@ -30,8 +30,10 @@ public final class LongsRef implements Comparable, Cloneable { /** The contents of the LongsRef. Should never be {@code null}. */ public long[] longs; + /** Offset of first valid long. */ public int offset; + /** Length of used longs. */ public int length; diff --git a/lucene/core/src/java/org/apache/lucene/util/MapOfSets.java b/lucene/core/src/java/org/apache/lucene/util/MapOfSets.java index bb4df20e384..5c579d1e7b6 100644 --- a/lucene/core/src/java/org/apache/lucene/util/MapOfSets.java +++ b/lucene/core/src/java/org/apache/lucene/util/MapOfSets.java @@ -56,6 +56,7 @@ public class MapOfSets { theSet.add(val); return theSet.size(); } + /** * Adds multiple vals to the Set associated with key in the Map. If key is not already in the map, * a new Set will first be created. diff --git a/lucene/core/src/java/org/apache/lucene/util/OfflineSorter.java b/lucene/core/src/java/org/apache/lucene/util/OfflineSorter.java index 295cba9c217..21fbf76d045 100644 --- a/lucene/core/src/java/org/apache/lucene/util/OfflineSorter.java +++ b/lucene/core/src/java/org/apache/lucene/util/OfflineSorter.java @@ -53,6 +53,7 @@ public class OfflineSorter { /** Convenience constant for megabytes */ public static final long MB = 1024 * 1024; + /** Convenience constant for gigabytes */ public static final long GB = MB * 1024; @@ -138,18 +139,25 @@ public class OfflineSorter { public class SortInfo { /** number of temporary files created when merging partitions */ public int tempMergeFiles; + /** number of partition merges */ public int mergeRounds; + /** number of lines of data read */ public long lineCount; + /** time spent merging sorted partitions (in milliseconds) */ public final AtomicLong mergeTimeMS = new AtomicLong(); + /** time spent sorting data (in milliseconds) */ public final AtomicLong sortTimeMS = new AtomicLong(); + /** total time spent (in milliseconds) */ public long totalTimeMS; + /** time spent in i/o read (in milliseconds) */ public long readTimeMS; + /** read buffer size (in bytes) */ public final long bufferSize = ramBufferSize.bytes; diff --git a/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java b/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java index 3ad17dca5ce..91861527ea7 100644 --- a/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java +++ b/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java @@ -66,6 +66,7 @@ public class QueryBuilder { public static class TermAndBoost { /** the term */ public final BytesRef term; + /** the boost */ public final float boost; diff --git a/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java b/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java index 060c8b3ef8b..29a214752e1 100644 --- a/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java +++ b/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java @@ -44,6 +44,7 @@ public class SentinelIntSet { public int count; public final int emptyVal; + /** the count at which a rehash should be done */ public int rehashCount; diff --git a/lucene/core/src/java/org/apache/lucene/util/SortableBytesRefArray.java b/lucene/core/src/java/org/apache/lucene/util/SortableBytesRefArray.java index 086fcbb4535..02f6c3c4b6a 100644 --- a/lucene/core/src/java/org/apache/lucene/util/SortableBytesRefArray.java +++ b/lucene/core/src/java/org/apache/lucene/util/SortableBytesRefArray.java @@ -22,10 +22,13 @@ import java.util.Comparator; interface SortableBytesRefArray { /** Append a new value */ int append(BytesRef bytes); + /** Clear all previously stored values */ void clear(); + /** Returns the number of values appended so far */ int size(); + /** Sort all values by the provided comparator and return an iterator over the sorted values */ BytesRefIterator iterator(final Comparator comp); } diff --git a/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java b/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java index bb6378c9656..c3182fe1ed7 100644 --- a/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java +++ b/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java @@ -534,14 +534,19 @@ public final class UnicodeUtil { /** Shift value for lead surrogate to form a supplementary character. */ private static final int LEAD_SURROGATE_SHIFT_ = 10; + /** Mask to retrieve the significant value from a trail surrogate. */ private static final int TRAIL_SURROGATE_MASK_ = 0x3FF; + /** Trail surrogate minimum value */ private static final int TRAIL_SURROGATE_MIN_VALUE = 0xDC00; + /** Lead surrogate minimum value */ private static final int LEAD_SURROGATE_MIN_VALUE = 0xD800; + /** The minimum value for Supplementary code points */ private static final int SUPPLEMENTARY_MIN_VALUE = 0x10000; + /** Value that all lead surrogate starts with */ private static final int LEAD_SURROGATE_OFFSET_ = LEAD_SURROGATE_MIN_VALUE - (SUPPLEMENTARY_MIN_VALUE >> LEAD_SURROGATE_SHIFT_); diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java index 19ef01e9406..f7c0ad42013 100644 --- a/lucene/core/src/java/org/apache/lucene/util/Version.java +++ b/lucene/core/src/java/org/apache/lucene/util/Version.java @@ -310,10 +310,13 @@ public final class Version { /** Major version, the difference between stable and trunk */ public final int major; + /** Minor version, incremented within the stable branch */ public final int minor; + /** Bugfix number, incremented on release branches */ public final int bugfix; + /** Prerelease version, currently 0 (alpha), 1 (beta), or 2 (final) */ public final int prerelease; diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/LevenshteinAutomata.java b/lucene/core/src/java/org/apache/lucene/util/automaton/LevenshteinAutomata.java index cc932c29f09..2e42f2e8551 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/LevenshteinAutomata.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/LevenshteinAutomata.java @@ -36,6 +36,7 @@ public class LevenshteinAutomata { * @lucene.internal */ public static final int MAXIMUM_SUPPORTED_DISTANCE = 2; + /* input word */ final int[] word; /* the automata alphabet. */ diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/RegExp.java b/lucene/core/src/java/org/apache/lucene/util/automaton/RegExp.java index 4806e75bcf7..ed1688efd30 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/RegExp.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/RegExp.java @@ -420,14 +420,19 @@ public class RegExp { // Immutable parsed state /** The type of expression */ public final Kind kind; + /** Child expressions held by a container type expression */ public final RegExp exp1, exp2; + /** String expression */ public final String s; + /** Character expression */ public final int c; + /** Limits for repeatable type expressions */ public final int min, max, digits; + /** Extents for range type expressions */ public final int from, to; @@ -456,6 +461,7 @@ public class RegExp { public RegExp(String s, int syntax_flags) throws IllegalArgumentException { this(s, syntax_flags, 0); } + /** * Constructs new RegExp from a string. * diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java index 5bea2e4ac5a..ab869cd6a95 100644 --- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java +++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java @@ -88,6 +88,7 @@ public class BKDWriter implements Closeable { /** Number of splits before we compute the exact bounding box of an inner node. */ private static final int SPLITS_BEFORE_EXACT_BOUNDS = 4; + /** Default maximum heap to use, before spilling to (slower) disk */ public static final float DEFAULT_MAX_MB_SORT_IN_HEAP = 16.0f; @@ -242,10 +243,13 @@ public class BKDWriter implements Closeable { private final int packedBytesLength; private final MergeState.DocMap docMap; private final MergeIntersectsVisitor mergeIntersectsVisitor; + /** Which doc in this block we are up to */ private int docBlockUpto; + /** Current doc ID */ public int docID; + /** Current packed value */ public final byte[] packedValue; @@ -392,17 +396,20 @@ public class BKDWriter implements Closeable { private interface BKDTreeLeafNodes { /** number of leaf nodes */ int numLeaves(); + /** * pointer to the leaf node previously written. Leaves are order from left to right, so leaf at * {@code index} 0 is the leftmost leaf and the leaf at {@code numleaves()} -1 is the rightmost * leaf */ long getLeafLP(int index); + /** * split value between two leaves. The split value at position n corresponds to the leaves at (n * -1) and n. */ BytesRef getSplitValue(int index); + /** * split dimension between two leaves. The split dimension at position n corresponds to the * leaves at (n -1) and n. diff --git a/lucene/core/src/java/org/apache/lucene/util/fst/FSTEnum.java b/lucene/core/src/java/org/apache/lucene/util/fst/FSTEnum.java index dc24aa7fb98..c1a815cd2b6 100644 --- a/lucene/core/src/java/org/apache/lucene/util/fst/FSTEnum.java +++ b/lucene/core/src/java/org/apache/lucene/util/fst/FSTEnum.java @@ -32,6 +32,7 @@ abstract class FSTEnum { @SuppressWarnings({"rawtypes", "unchecked"}) protected FST.Arc[] arcs = new FST.Arc[10]; + // outputs are cumulative @SuppressWarnings({"rawtypes", "unchecked"}) protected T[] output = (T[]) new Object[10]; diff --git a/lucene/core/src/java/org/apache/lucene/util/fst/Util.java b/lucene/core/src/java/org/apache/lucene/util/fst/Util.java index f8d82cbe855..9895dd6b14e 100644 --- a/lucene/core/src/java/org/apache/lucene/util/fst/Util.java +++ b/lucene/core/src/java/org/apache/lucene/util/fst/Util.java @@ -100,6 +100,7 @@ public final class Util { public static class FSTPath { /** Holds the last arc appended to this path */ public FST.Arc arc; + /** Holds cost plus any usage-specific output: */ public T output; @@ -446,6 +447,7 @@ public final class Util { * TopNSearcher} rejected too many results. */ public final boolean isComplete; + /** The top results */ public final List> topN; diff --git a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java index 39605989bb8..8fb85df372b 100644 --- a/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java +++ b/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java @@ -398,6 +398,7 @@ public final class HnswGraphBuilder { private final NeighborQueue queue; private final int k; private long visitedCount; + /** * @param k the number of neighbors to collect */ diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java index 083ba6c6c98..475ebf59bef 100644 --- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java +++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java @@ -40,8 +40,10 @@ class Packed64 extends PackedInts.MutableImpl { /** Values are stores contiguously in the blocks array. */ private final long[] blocks; + /** A right-aligned mask of width BitsPerValue used by {@link #get(int)}. */ private final long maskRight; + /** Optimization: Saves one lookup in {@link #get(int)}. */ private final int bpvMinusBlockSize; diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java index 70771b22ecc..4e385e385f0 100644 --- a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java +++ b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java @@ -403,15 +403,19 @@ public class PackedInts { public static interface ReaderIterator { /** Returns next value */ long next() throws IOException; + /** * Returns at least 1 and at most count next values, the returned ref MUST NOT be * modified */ LongsRef next(int count) throws IOException; + /** Returns number of bits per value */ int getBitsPerValue(); + /** Returns number of values */ int size(); + /** Returns the current position */ int ord(); } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java index 125537b30cd..1a5845d43d4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java @@ -486,6 +486,7 @@ public class TestPostingsOffsets extends LuceneTestCase { iw.close(); dir.close(); } + // TODO: more tests with other possibilities private void checkTokens(Token[] field1, Token[] field2) throws IOException { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java index dd86e779757..2413e1b9e23 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java @@ -53,10 +53,13 @@ public class TestBoolean2 extends LuceneTestCase { private static IndexReader reader; private static IndexReader littleReader; private static IndexReader singleSegmentReader; + /** num of empty docs injected between every doc in the (main) index */ private static int NUM_FILLER_DOCS; + /** num of empty docs injected prior to the first doc in the (main) index */ private static int PRE_FILLER_DOCS; + /** num "extra" docs containing value in "field2" added to the "big" clone of the index */ private static final int NUM_EXTRA_DOCS = 6000; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java index 32bdd5bd846..93dd4402c4c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java @@ -35,8 +35,10 @@ public class TestSimpleExplanationsWithFillerDocs extends TestSimpleExplanations /** num of empty docs injected between every doc in the index */ private static final int NUM_FILLER_DOCS = TEST_NIGHTLY ? BooleanScorer.SIZE : 4; + /** num of empty docs injected prior to the first doc in the (main) index */ private static int PRE_FILLER_DOCS; + /** * If non-null then the filler docs are not empty, and need to be filtered out from queries using * this as both field name & field value diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java index 49bee3f8a80..6bb581d108a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java @@ -69,14 +69,18 @@ import org.apache.lucene.util.Version; public class TestSimilarityBase extends LuceneTestCase { private static String FIELD_BODY = "body"; private static String FIELD_ID = "id"; + /** The tolerance range for float equality. */ private static float FLOAT_EPSILON = 1e-5f; + /** The DFR basic models to test. */ static BasicModel[] BASIC_MODELS = { new BasicModelG(), new BasicModelIF(), new BasicModelIn(), new BasicModelIne() }; + /** The DFR aftereffects to test. */ static AfterEffect[] AFTER_EFFECTS = {new AfterEffectB(), new AfterEffectL()}; + /** The DFR normalizations to test. */ static Normalization[] NORMALIZATIONS = { new NormalizationH1(), @@ -85,10 +89,13 @@ public class TestSimilarityBase extends LuceneTestCase { new NormalizationZ(), new Normalization.NoNormalization() }; + /** The distributions for IB. */ static Distribution[] DISTRIBUTIONS = {new DistributionLL(), new DistributionSPL()}; + /** Lambdas for IB. */ static Lambda[] LAMBDAS = {new LambdaDF(), new LambdaTTF()}; + /** Independence measures for DFI */ static Independence[] INDEPENDENCE_MEASURES = { new IndependenceStandardized(), new IndependenceSaturated(), new IndependenceChiSquared() @@ -97,6 +104,7 @@ public class TestSimilarityBase extends LuceneTestCase { private IndexSearcher searcher; private Directory dir; private IndexReader reader; + /** The list of similarities to test. */ private List sims; @@ -147,12 +155,16 @@ public class TestSimilarityBase extends LuceneTestCase { /** The default number of documents in the unit tests. */ private static int NUMBER_OF_DOCUMENTS = 100; + /** The default total number of tokens in the field in the unit tests. */ private static long NUMBER_OF_FIELD_TOKENS = 5000; + /** The default average field length in the unit tests. */ private static float AVG_FIELD_LENGTH = 50; + /** The default document frequency in the unit tests. */ private static int DOC_FREQ = 10; + /** * The default total number of occurrences of this term across all documents in the unit tests. */ @@ -160,6 +172,7 @@ public class TestSimilarityBase extends LuceneTestCase { /** The default tf in the unit tests. */ private static float FREQ = 7; + /** The default document length in the unit tests. */ private static int DOC_LEN = 40; @@ -194,6 +207,7 @@ public class TestSimilarityBase extends LuceneTestCase { return new TermStatistics( new BytesRef("spoofyText"), stats.getDocFreq(), stats.getTotalTermFreq()); } + /** * The generic test core called by all unit test methods. It calls the {@link * SimilarityBase#score(BasicStats, double, double)} method of all Similarities in {@link #sims} diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/CustomFacetSetExample.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/CustomFacetSetExample.java index b66196c3236..d3000b46037 100644 --- a/lucene/demo/src/java/org/apache/lucene/demo/facet/CustomFacetSetExample.java +++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/CustomFacetSetExample.java @@ -200,6 +200,7 @@ public class CustomFacetSetExample { return facets.getAllChildren("temperature"); } } + /** Counting documents which match a certain degrees value for any date. */ private FacetResult rangeMatching() throws IOException { try (DirectoryReader indexReader = DirectoryReader.open(indexDir)) { diff --git a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestScripts.java b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestScripts.java index 6db60a7202d..153d0f1e168 100644 --- a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestScripts.java +++ b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestScripts.java @@ -80,6 +80,7 @@ public class TestScripts extends AbstractLuceneDistributionTest { /** The value of System.getProperty("os.name"). * */ public static final String OS_NAME = System.getProperty("os.name"); + /** True iff running on Windows. */ public static final boolean WINDOWS = OS_NAME.startsWith("Windows"); diff --git a/lucene/expressions/src/generated/checksums/generateAntlr.json b/lucene/expressions/src/generated/checksums/generateAntlr.json index cc3723b80e1..1f61888a1c6 100644 --- a/lucene/expressions/src/generated/checksums/generateAntlr.json +++ b/lucene/expressions/src/generated/checksums/generateAntlr.json @@ -1,7 +1,7 @@ { "lucene/expressions/src/java/org/apache/lucene/expressions/js/Javascript.g4": "818e89aae0b6c7601051802013898c128fe7c1ba", - "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java": "706c11702149d135fc7ebe13ec1fe01800338260", + "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java": "6965abdb8b069aaceac1ce4f32ed965b194f3a25", "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java": "b8d6b259ebbfce09a5379a1a2aa4c1ddd4e378eb", "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java": "7a3a7b9de17f4a8d41ef342312eae5c55e483e08", - "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java": "ebf033dc72e63203e5d4d85fd57114dd973482dc" + "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java": "ec24bb2b9004bc38ee808970870deed12351039e" } \ No newline at end of file diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java index 30a2e55d3b4..d14cda07b4a 100644 --- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java +++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java @@ -22,6 +22,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitCompile(JavascriptParser.CompileContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -32,6 +33,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitConditional(JavascriptParser.ConditionalContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -42,6 +44,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBoolor(JavascriptParser.BoolorContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -52,6 +55,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBoolcomp(JavascriptParser.BoolcompContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -62,6 +66,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitNumeric(JavascriptParser.NumericContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -72,6 +77,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitAddsub(JavascriptParser.AddsubContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -82,6 +88,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitUnary(JavascriptParser.UnaryContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -92,6 +99,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitPrecedence(JavascriptParser.PrecedenceContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -102,6 +110,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitMuldiv(JavascriptParser.MuldivContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -112,6 +121,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitExternal(JavascriptParser.ExternalContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -122,6 +132,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBwshift(JavascriptParser.BwshiftContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -132,6 +143,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBwor(JavascriptParser.BworContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -142,6 +154,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBooland(JavascriptParser.BoolandContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -152,6 +165,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBwxor(JavascriptParser.BwxorContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * @@ -162,6 +176,7 @@ class JavascriptBaseVisitor extends AbstractParseTreeVisitor implements Ja public T visitBwand(JavascriptParser.BwandContext ctx) { return visitChildren(ctx); } + /** * {@inheritDoc} * diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java index 3c6f1d2e9a6..cd2fbe6177a 100644 --- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java +++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java @@ -18,6 +18,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitCompile(JavascriptParser.CompileContext ctx); + /** * Visit a parse tree produced by the {@code conditional} labeled alternative in {@link * JavascriptParser#expression}. @@ -26,6 +27,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitConditional(JavascriptParser.ConditionalContext ctx); + /** * Visit a parse tree produced by the {@code boolor} labeled alternative in {@link * JavascriptParser#expression}. @@ -34,6 +36,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBoolor(JavascriptParser.BoolorContext ctx); + /** * Visit a parse tree produced by the {@code boolcomp} labeled alternative in {@link * JavascriptParser#expression}. @@ -42,6 +45,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBoolcomp(JavascriptParser.BoolcompContext ctx); + /** * Visit a parse tree produced by the {@code numeric} labeled alternative in {@link * JavascriptParser#expression}. @@ -50,6 +54,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitNumeric(JavascriptParser.NumericContext ctx); + /** * Visit a parse tree produced by the {@code addsub} labeled alternative in {@link * JavascriptParser#expression}. @@ -58,6 +63,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitAddsub(JavascriptParser.AddsubContext ctx); + /** * Visit a parse tree produced by the {@code unary} labeled alternative in {@link * JavascriptParser#expression}. @@ -66,6 +72,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitUnary(JavascriptParser.UnaryContext ctx); + /** * Visit a parse tree produced by the {@code precedence} labeled alternative in {@link * JavascriptParser#expression}. @@ -74,6 +81,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitPrecedence(JavascriptParser.PrecedenceContext ctx); + /** * Visit a parse tree produced by the {@code muldiv} labeled alternative in {@link * JavascriptParser#expression}. @@ -82,6 +90,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitMuldiv(JavascriptParser.MuldivContext ctx); + /** * Visit a parse tree produced by the {@code external} labeled alternative in {@link * JavascriptParser#expression}. @@ -90,6 +99,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitExternal(JavascriptParser.ExternalContext ctx); + /** * Visit a parse tree produced by the {@code bwshift} labeled alternative in {@link * JavascriptParser#expression}. @@ -98,6 +108,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBwshift(JavascriptParser.BwshiftContext ctx); + /** * Visit a parse tree produced by the {@code bwor} labeled alternative in {@link * JavascriptParser#expression}. @@ -106,6 +117,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBwor(JavascriptParser.BworContext ctx); + /** * Visit a parse tree produced by the {@code booland} labeled alternative in {@link * JavascriptParser#expression}. @@ -114,6 +126,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBooland(JavascriptParser.BoolandContext ctx); + /** * Visit a parse tree produced by the {@code bwxor} labeled alternative in {@link * JavascriptParser#expression}. @@ -122,6 +135,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBwxor(JavascriptParser.BwxorContext ctx); + /** * Visit a parse tree produced by the {@code bwand} labeled alternative in {@link * JavascriptParser#expression}. @@ -130,6 +144,7 @@ interface JavascriptVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBwand(JavascriptParser.BwandContext ctx); + /** * Visit a parse tree produced by the {@code booleqne} labeled alternative in {@link * JavascriptParser#expression}. diff --git a/lucene/facet/src/java/org/apache/lucene/facet/range/ExclusiveLongRangeCounter.java b/lucene/facet/src/java/org/apache/lucene/facet/range/ExclusiveLongRangeCounter.java index 37051df427d..f8c4d7e763f 100644 --- a/lucene/facet/src/java/org/apache/lucene/facet/range/ExclusiveLongRangeCounter.java +++ b/lucene/facet/src/java/org/apache/lucene/facet/range/ExclusiveLongRangeCounter.java @@ -30,10 +30,13 @@ class ExclusiveLongRangeCounter extends LongRangeCounter { /** elementary interval boundaries used for efficient counting (bsearch to find interval) */ private final long[] boundaries; + /** original range number each elementary interval corresponds to (index into countBuffer) */ private final int[] rangeNums; + /** number of counted documents that haven't matched any requested ranges */ private int missingCount; + /** whether-or-not the multi-valued doc currently being counted has matched any ranges */ private boolean multiValuedDocMatchedRange; diff --git a/lucene/facet/src/java/org/apache/lucene/facet/range/OverlappingLongRangeCounter.java b/lucene/facet/src/java/org/apache/lucene/facet/range/OverlappingLongRangeCounter.java index b478e3994e1..498cb6b4d11 100644 --- a/lucene/facet/src/java/org/apache/lucene/facet/range/OverlappingLongRangeCounter.java +++ b/lucene/facet/src/java/org/apache/lucene/facet/range/OverlappingLongRangeCounter.java @@ -34,8 +34,10 @@ class OverlappingLongRangeCounter extends LongRangeCounter { /** segment tree root node */ private final LongRangeNode root; + /** elementary interval boundaries used for efficient counting (bsearch to find interval) */ private final long[] boundaries; + /** * whether-or-not there are elementary interval counts that still need to be rolled up at the end */ @@ -48,11 +50,13 @@ class OverlappingLongRangeCounter extends LongRangeCounter { // Needed only for counting multi-valued docs: /** whether-or-not an elementary interval has seen at least one match for a single doc */ private FixedBitSet multiValuedDocElementaryIntervalHits; + /** whether-or-not a requested range has seen at least one match for a single doc */ private FixedBitSet multiValuedDocRangeHits; // Used during rollup private int elementaryIntervalUpto; + /** number of counted documents that haven't matched any requested ranges */ private int missingCount; diff --git a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java index 074f87ee5f8..31de3678db2 100644 --- a/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java +++ b/lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesReaderState.java @@ -42,6 +42,7 @@ public abstract class SortedSetDocValuesReaderState implements Accountable { public static final class OrdRange { /** Start of range, inclusive: */ public final int start; + /** End of range, inclusive: */ public final int end; diff --git a/lucene/grouping/src/java/org/apache/lucene/search/grouping/DoubleRange.java b/lucene/grouping/src/java/org/apache/lucene/search/grouping/DoubleRange.java index 3ca4b8df5b5..824d33df60c 100644 --- a/lucene/grouping/src/java/org/apache/lucene/search/grouping/DoubleRange.java +++ b/lucene/grouping/src/java/org/apache/lucene/search/grouping/DoubleRange.java @@ -26,6 +26,7 @@ public class DoubleRange { /** The inclusive minimum value of this range */ public double min; + /** The exclusive maximum value of this range */ public double max; diff --git a/lucene/grouping/src/java/org/apache/lucene/search/grouping/LongRange.java b/lucene/grouping/src/java/org/apache/lucene/search/grouping/LongRange.java index 9b631d1d963..4a6d457d70d 100644 --- a/lucene/grouping/src/java/org/apache/lucene/search/grouping/LongRange.java +++ b/lucene/grouping/src/java/org/apache/lucene/search/grouping/LongRange.java @@ -24,6 +24,7 @@ public class LongRange { /** The inclusive minimum value of this range */ public long min; + /** The exclusive maximum value of this range */ public long max; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/Formatter.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/Formatter.java index 7d9190eb97e..87b686599cf 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/Formatter.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/Formatter.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** * Processes terms found in the original text, typically by applying some form of mark-up to * highlight terms in HTML search results pages. diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java index cf602ebb720..5599ff58fe9 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** Formats text with different color intensity depending on the score of the term. */ public class GradientFormatter implements Formatter { private float maxScore; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/InvalidTokenOffsetsException.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/InvalidTokenOffsetsException.java index 8c7f9613846..53cb9db75aa 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/InvalidTokenOffsetsException.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/InvalidTokenOffsetsException.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** Exception thrown if TokenStream Tokens are incompatible with provided text */ public class InvalidTokenOffsetsException extends Exception { diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/PositionSpan.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/PositionSpan.java index c08abc7435f..534c98fe60c 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/PositionSpan.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/PositionSpan.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** * Utility class to record Positions Spans * diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java index ec25cf782dc..dfcdce34e66 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** * Formats text with different color intensity depending on the score of the term using the span * tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java index 406f8f71cc4..53d5794f156 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** Low-level class used to record information about a section of a document with a score. */ public class TextFragment { CharSequence markedUpText; @@ -36,6 +37,7 @@ public class TextFragment { public float getScore() { return score; } + /** * @param frag2 Fragment to be merged into this one */ @@ -43,6 +45,7 @@ public class TextFragment { textEndPos = frag2.textEndPos; score = Math.max(score, frag2.score); } + /** * @return true if this fragment follows the one passed */ diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedTerm.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedTerm.java index c5feccdd79f..77914ca0aa7 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedTerm.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedTerm.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.search.highlight; + /** Lightweight class to hold term and a weight value used for scoring this term */ public class WeightedTerm { float weight; // multiplier diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/DefaultPassageFormatter.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/DefaultPassageFormatter.java index 345e2b61316..b578c7427ce 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/DefaultPassageFormatter.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/DefaultPassageFormatter.java @@ -25,10 +25,13 @@ package org.apache.lucene.search.uhighlight; public class DefaultPassageFormatter extends PassageFormatter { /** text that will appear before highlighted terms */ protected final String preTag; + /** text that will appear after highlighted terms */ protected final String postTag; + /** text that will appear between two unconnected passages */ protected final String ellipsis; + /** true if we should escape for html */ protected final boolean escape; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PassageScorer.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PassageScorer.java index 34b5b662d3e..fb43853c68e 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PassageScorer.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PassageScorer.java @@ -34,8 +34,10 @@ public class PassageScorer { /** BM25 k1 parameter, controls term frequency normalization */ final float k1; + /** BM25 b parameter, controls length normalization. */ final float b; + /** A pivot used for length normalization. */ final float pivot; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java index 93d81f234dd..ca7d4e3ac8e 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java @@ -190,6 +190,7 @@ public class FieldTermStack { void setNext(TermInfo next) { this.next = next; } + /** Returns the next TermInfo at this same position. This is a circular list! */ public TermInfo getNext() { return next; diff --git a/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java b/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java index 6134cd0e1dd..4aa3b64aeb4 100644 --- a/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java +++ b/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java @@ -391,6 +391,7 @@ public class ToParentBlockJoinQuery extends Query { } this.score = (float) score; } + /* * This instance of Explanation requires three parameters, context, childWeight, and scoreMode. * The scoreMode parameter considers Avg, Total, Min, Max, and None. diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java index 83140feb7c1..6f5235dd3ee 100644 --- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java +++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java @@ -243,6 +243,7 @@ public class MemoryIndex { public SliceWriter(SlicedIntBlockPool slicedIntBlockPool) { this.slicedIntBlockPool = slicedIntBlockPool; } + /** */ public void reset(int sliceOffset) { this.offset = sliceOffset; diff --git a/lucene/misc/src/java/org/apache/lucene/misc/store/ByteWritesTrackingDirectoryWrapper.java b/lucene/misc/src/java/org/apache/lucene/misc/store/ByteWritesTrackingDirectoryWrapper.java index 6619bf8ddbe..c82f26a8f66 100644 --- a/lucene/misc/src/java/org/apache/lucene/misc/store/ByteWritesTrackingDirectoryWrapper.java +++ b/lucene/misc/src/java/org/apache/lucene/misc/store/ByteWritesTrackingDirectoryWrapper.java @@ -33,6 +33,7 @@ public final class ByteWritesTrackingDirectoryWrapper extends FilterDirectory { public ByteWritesTrackingDirectoryWrapper(Directory in) { this(in, false); } + /** * Constructor with option to track tempOutput * diff --git a/lucene/misc/src/java/org/apache/lucene/misc/store/RAFDirectory.java b/lucene/misc/src/java/org/apache/lucene/misc/store/RAFDirectory.java index 731a0de47e4..420d6d40d6d 100644 --- a/lucene/misc/src/java/org/apache/lucene/misc/store/RAFDirectory.java +++ b/lucene/misc/src/java/org/apache/lucene/misc/store/RAFDirectory.java @@ -93,10 +93,13 @@ public class RAFDirectory extends FSDirectory { /** the file channel we will read from */ protected final RandomAccessFile file; + /** is this instance a clone and hence does not own the file to close it */ boolean isClone = false; + /** start offset: non-zero in the slice case */ protected final long off; + /** end offset (start+length) */ protected final long end; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java b/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java index 0bfbfa52149..5aa7687a621 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java @@ -58,6 +58,7 @@ public class TestHighFreqTerms extends LuceneTestCase { reader = null; writer = null; } + /******************** Tests for getHighFreqTerms **********************************/ // test without specifying field (i.e. if we pass in field=null it should examine all fields) diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionValues.java b/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionValues.java index 6b2a8a1f546..ed38e3e723c 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionValues.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionValues.java @@ -61,6 +61,7 @@ public abstract class FunctionValues { public double doubleVal(int doc) throws IOException { throw new UnsupportedOperationException(); } + // TODO: should we make a termVal, returns BytesRef? public String strVal(int doc) throws IOException { throw new UnsupportedOperationException(); diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java index 0e1abb7d937..9b56fec2c53 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/DualFloatFunction.java @@ -61,6 +61,7 @@ public abstract class DualFloatFunction extends ValueSource { public float floatVal(int doc) throws IOException { return func(doc, aVals, bVals); } + /** * True if and only if all of the wrapped {@link FunctionValues} exists * for the specified doc diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java index 701d4b02fbe..a47d7fce0fb 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MultiFloatFunction.java @@ -39,6 +39,7 @@ public abstract class MultiFloatFunction extends ValueSource { protected abstract String name(); protected abstract float func(int doc, FunctionValues[] valsArr) throws IOException; + /** * Called by {@link FunctionValues#exists} for each document. * diff --git a/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java b/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java index 9314d5c344a..46198733341 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java @@ -756,6 +756,7 @@ public final class MoreLikeThis { } return createQueue(field2termFreqMap); } + /** * Adds terms and frequencies found in vector into the Map termFreqMap * diff --git a/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java b/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java index ef04a8dccd0..448a9989490 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java @@ -47,6 +47,7 @@ public class SpanPayloadCheckQuery extends SpanQuery { protected final SpanQuery match; protected final MatchOperation operation; protected final PayloadType payloadType; + /** The payload type. This specifies the decoding of the ByteRef for the payload. */ public enum PayloadType { /** INT is for a 4 byte payload that is a packed integer */ diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java b/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java index e5f3ce04fcc..2c5eef9f6df 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java @@ -56,11 +56,13 @@ public abstract class FunctionTestSetup extends LuceneTestCase { protected static final String ID_FIELD = "id"; protected static final String TEXT_FIELD = "text"; protected static final String INT_FIELD = "iii"; + /** * This field is multiValued and should give the exact same results as {@link #INT_FIELD} when * used with MIN selector */ protected static final String INT_FIELD_MV_MIN = "iii_min"; + /** * This field is multiValued and should give the exact same results as {@link #INT_FIELD} when * used with MAX selector @@ -68,11 +70,13 @@ public abstract class FunctionTestSetup extends LuceneTestCase { protected static final String INT_FIELD_MV_MAX = "iii_max"; protected static final String FLOAT_FIELD = "fff"; + /** * This field is multiValued and should give the exact same results as {@link #FLOAT_FIELD} when * used with MIN selector */ protected static final String FLOAT_FIELD_MV_MIN = "fff_min"; + /** * This field is multiValued and should give the exact same results as {@link #FLOAT_FIELD} when * used with MAX selector diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java index a2a8c27b056..7cd37bba317 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java @@ -877,6 +877,7 @@ public class TestValueSources extends LuceneTestCase { void assertAllExist(ValueSource vs) { assertExists(ALL_EXIST_VS, vs); } + /** * Asserts that for every doc, the {@link FunctionValues#exists} value from the {@link * ValueSource} is false. @@ -884,6 +885,7 @@ public class TestValueSources extends LuceneTestCase { void assertNoneExist(ValueSource vs) { assertExists(NONE_EXIST_VS, vs); } + /** * Asserts that for every doc, the {@link FunctionValues#exists} value from the actual * {@link ValueSource} matches the {@link FunctionValues#exists} value from the @@ -975,6 +977,7 @@ public class TestValueSources extends LuceneTestCase { * @see ExistsValueSource */ private static final ValueSource ALL_EXIST_VS = new ExistsValueSource(true); + /** * @see ExistsValueSource */ diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java index e17b5a67a5d..e202d81e832 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java @@ -52,6 +52,7 @@ public abstract class BaseSpanExplanationTestCase extends BaseExplanationTestCas public SpanQuery sor(String s, String m, String e) { return spanOrQuery(FIELD, s, m, e); } + /** MACRO for SpanOrQuery containing two SpanQueries */ public SpanQuery sor(SpanQuery s, SpanQuery m, SpanQuery e) { return spanOrQuery(s, m, e); @@ -75,6 +76,7 @@ public abstract class BaseSpanExplanationTestCase extends BaseExplanationTestCas public SpanQuery snear(String s, String m, String e, int slop, boolean inOrder) { return snear(st(s), st(m), st(e), slop, inOrder); } + /** MACRO for SpanNearQuery containing three SpanQueries */ public SpanQuery snear(SpanQuery s, SpanQuery m, SpanQuery e, int slop, boolean inOrder) { if (inOrder) { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java index 3d49b30a960..06b8da14a26 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java @@ -77,6 +77,7 @@ public class TestSpanSimilarity extends LuceneTestCase { static BasicModel[] BASIC_MODELS = { new BasicModelG(), new BasicModelIF(), new BasicModelIn(), new BasicModelIne() }; + /** The DFR aftereffects to test. */ static AfterEffect[] AFTER_EFFECTS = {new AfterEffectB(), new AfterEffectL()}; @@ -87,10 +88,13 @@ public class TestSpanSimilarity extends LuceneTestCase { new NormalizationZ(), new Normalization.NoNormalization() }; + /** The distributions for IB. */ static Distribution[] DISTRIBUTIONS = {new DistributionLL(), new DistributionSPL()}; + /** Lambdas for IB. */ static Lambda[] LAMBDAS = {new LambdaDF(), new LambdaTTF()}; + /** Independence measures for DFI */ static Independence[] INDEPENDENCE_MEASURES = { new IndependenceStandardized(), new IndependenceSaturated(), new IndependenceChiSquared() diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java index 418f91f4fb6..f8d0d539e49 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java @@ -76,6 +76,7 @@ public abstract class QueryParserBase extends QueryBuilder // the nested class: /** Alternative form of QueryParser.Operator.AND */ public static final Operator AND_OPERATOR = Operator.AND; + /** Alternative form of QueryParser.Operator.OR */ public static final Operator OR_OPERATOR = Operator.OR; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/Extensions.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/Extensions.java index 30234185035..c2dda823598 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/Extensions.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/Extensions.java @@ -39,6 +39,7 @@ import org.apache.lucene.queryparser.classic.QueryParserBase; public class Extensions { private final Map extensions = new HashMap<>(); private final char extensionFieldDelimiter; + /** The default extension field delimiter character. This constant is set to ':' */ public static final char DEFAULT_EXTENSION_FIELD_DELIMITER = ':'; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java index a5dac1c6c4e..93ac8463349 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java @@ -42,6 +42,7 @@ public class PathQueryNode extends QueryNodeImpl { /** Term text with a beginning and end position */ public static class QueryText implements Cloneable { CharSequence value = null; + /** != null The term's begin position. */ int begin; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/SimpleQueryParser.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/SimpleQueryParser.java index 5d0540012ab..9133b06149f 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/SimpleQueryParser.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/SimpleQueryParser.java @@ -103,27 +103,37 @@ import org.apache.lucene.util.automaton.LevenshteinAutomata; public class SimpleQueryParser extends QueryBuilder { /** Map of fields to query against with their weights */ protected final Map weights; + /** flags to the parser (to turn features on/off) */ protected final int flags; /** Enables {@code AND} operator (+) */ public static final int AND_OPERATOR = 1 << 0; + /** Enables {@code NOT} operator (-) */ public static final int NOT_OPERATOR = 1 << 1; + /** Enables {@code OR} operator (|) */ public static final int OR_OPERATOR = 1 << 2; + /** Enables {@code PREFIX} operator (*) */ public static final int PREFIX_OPERATOR = 1 << 3; + /** Enables {@code PHRASE} operator (") */ public static final int PHRASE_OPERATOR = 1 << 4; + /** Enables {@code PRECEDENCE} operators: {@code (} and {@code )} */ public static final int PRECEDENCE_OPERATORS = 1 << 5; + /** Enables {@code ESCAPE} operator (\) */ public static final int ESCAPE_OPERATOR = 1 << 6; + /** Enables {@code WHITESPACE} operators: ' ' '\n' '\r' '\t' */ public static final int WHITESPACE_OPERATOR = 1 << 7; + /** Enables {@code FUZZY} operators: (~) on single terms */ public static final int FUZZY_OPERATOR = 1 << 8; + /** Enables {@code NEAR} operators: (~) on phrases */ public static final int NEAR_OPERATOR = 1 << 9; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/BasicQueryFactory.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/BasicQueryFactory.java index e1f1407a723..7ff029b6f3f 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/BasicQueryFactory.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/BasicQueryFactory.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.queryparser.surround.query; + /* Create basic queries to be used during rewrite. * The basic queries are TermQuery and SpanTermQuery. * An exception can be thrown when too many of these are used. diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/SpanNearClauseFactory.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/SpanNearClauseFactory.java index 6574b95fa65..fc7f9b98557 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/SpanNearClauseFactory.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/SpanNearClauseFactory.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.lucene.queryparser.surround.query; + /* SpanNearClauseFactory: diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java index 5b3f7f8f1f8..4b2534e13df 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java @@ -243,6 +243,7 @@ public class TestMultiAnalyzer extends BaseTokenStreamTestCase { public Query getSuperFieldQuery(String f, String t, boolean quoted) throws ParseException { return super.getFieldQuery(f, t, quoted); } + /** wrap super's version */ @Override protected Query getFieldQuery(String f, String t, boolean quoted) throws ParseException { diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionBlockTreeTermsWriter.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionBlockTreeTermsWriter.java index fd2d2a648d8..2cfc4949b62 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionBlockTreeTermsWriter.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionBlockTreeTermsWriter.java @@ -323,6 +323,7 @@ public final class VersionBlockTreeTermsWriter extends FieldsConsumer { public final boolean hasTerms; public final boolean isFloor; public final int floorLeadByte; + /** Max version for all terms in this block. */ private final long maxVersion; diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionFieldReader.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionFieldReader.java index 3ded84c43da..716590d1ada 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionFieldReader.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/codecs/idversion/VersionFieldReader.java @@ -43,6 +43,7 @@ final class VersionFieldReader extends Terms { final VersionBlockTreeTermsReader parent; final FST> index; + // private boolean DEBUG; VersionFieldReader( diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/document/FloatPointNearestNeighbor.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/document/FloatPointNearestNeighbor.java index 0e0922f028b..4e4417814a4 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/document/FloatPointNearestNeighbor.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/document/FloatPointNearestNeighbor.java @@ -44,6 +44,7 @@ public class FloatPointNearestNeighbor { final byte[] minPacked; final byte[] maxPacked; final PointTree index; + /** The closest possible distance^2 of all points in this cell */ final double distanceSquared; diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/index/MergeOnFlushMergePolicy.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/index/MergeOnFlushMergePolicy.java index 109f1606ad9..bd70e9a2305 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/index/MergeOnFlushMergePolicy.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/index/MergeOnFlushMergePolicy.java @@ -73,6 +73,7 @@ public class MergeOnFlushMergePolicy extends FilterMergePolicy { } return null; } + /** Utility class to handle conversion between megabytes and bytes */ static class Units { diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java index 837de213d22..4a5c61af7cc 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java @@ -141,6 +141,7 @@ public abstract class MultiRangeQuery extends Query implements Cloneable { final int numDims; final int bytesPerDim; List rangeClauses; + /** * Expert: create a multidimensional range query with multiple connected ranges * @@ -516,6 +517,7 @@ public abstract class MultiRangeQuery extends Query implements Cloneable { private interface Relatable { /** return true if the provided point is inside the range */ boolean matches(byte[] packedValue); + /** return the relation between this range and the provided range */ PointValues.Relation relate(byte[] minPackedValue, byte[] maxPackedValue); } @@ -527,6 +529,7 @@ public abstract class MultiRangeQuery extends Query implements Cloneable { private interface Range extends Relatable { /** min value of this range */ byte[] getMinPackedValue(); + /** max value of this range */ byte[] getMaxPackedValue(); } @@ -538,12 +541,16 @@ public abstract class MultiRangeQuery extends Query implements Cloneable { /** Left child, it can be null */ private RangeTree left; + /** Right child, it can be null */ private RangeTree right; + /** which dimension was this node split on */ private final int split; + /** Range of this tree node */ private final Range component; + // Utility variables for computing relationships private final ArrayUtil.ByteArrayComparator comparator; private final int numIndexDim; diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/QueryProfilerTree.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/QueryProfilerTree.java index 8a0da1f5bb7..98860e9f56c 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/QueryProfilerTree.java +++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/QueryProfilerTree.java @@ -31,12 +31,16 @@ import org.apache.lucene.search.Query; class QueryProfilerTree { private final ArrayList breakdowns; + /** Maps the Query to it's list of children. This is basically the dependency tree */ private final ArrayList> tree; + /** A list of the original queries, keyed by index position */ private final ArrayList queries; + /** A list of top-level "roots". Each root can have its own tree of profiles */ private final ArrayList roots; + /** A temporary stack used to record where we are in the dependency tree. */ private final Deque stack; diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java index 07b1bbe65e0..fd9bc50daf4 100644 --- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java +++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java @@ -239,11 +239,13 @@ public abstract class NumberRangePrefixTree extends SpatialPrefixTree { /** Get the prefix tree level, the higher the more precise. 0 means the world (universe). */ int getLevel(); + /** * Gets the value at the specified level of this unit. level must be >= 0 and <= * getLevel(). */ int getValAtLevel(int level); + /** Gets an ancestor at the specified level. It shares state, so you may want to clone() it. */ UnitNRShape getShapeAtLevel(int level); diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/query/SpatialOperation.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/query/SpatialOperation.java index b865ea2be24..269e3e128ad 100644 --- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/query/SpatialOperation.java +++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/query/SpatialOperation.java @@ -57,6 +57,7 @@ public abstract class SpatialOperation implements Serializable { return indexedShape.getBoundingBox().relate(queryShape).intersects(); } }; + /** Bounding box of the *indexed* shape, then {@link #IsWithin}. */ public static final SpatialOperation BBoxWithin = new SpatialOperation("BBoxWithin") { @@ -70,6 +71,7 @@ public abstract class SpatialOperation implements Serializable { return bbox.relate(queryShape) == SpatialRelation.WITHIN || bbox.equals(queryShape); } }; + /** Meets the "Covers" OGC definition (boundary-neutral). */ public static final SpatialOperation Contains = new SpatialOperation("Contains") { @@ -83,6 +85,7 @@ public abstract class SpatialOperation implements Serializable { || indexedShape.equals(queryShape); } }; + /** Meets the "Intersects" OGC definition. */ public static final SpatialOperation Intersects = new SpatialOperation("Intersects") { @@ -91,6 +94,7 @@ public abstract class SpatialOperation implements Serializable { return indexedShape.relate(queryShape).intersects(); } }; + /** Meets the "Equals" OGC definition. */ public static final SpatialOperation IsEqualTo = new SpatialOperation("Equals") { @@ -103,6 +107,7 @@ public abstract class SpatialOperation implements Serializable { return indexedShape.equals(queryShape); } }; + /** Meets the "Disjoint" OGC definition. */ public static final SpatialOperation IsDisjointTo = new SpatialOperation("Disjoint") { @@ -115,6 +120,7 @@ public abstract class SpatialOperation implements Serializable { return !indexedShape.relate(queryShape).intersects(); } }; + /** Meets the "CoveredBy" OGC definition (boundary-neutral). */ public static final SpatialOperation IsWithin = new SpatialOperation("Within") { @@ -129,6 +135,7 @@ public abstract class SpatialOperation implements Serializable { || indexedShape.equals(queryShape); } }; + /** Almost meets the "Overlaps" OGC definition, but boundary-neutral (boundary==interior). */ public static final SpatialOperation Overlaps = new SpatialOperation("Overlaps") { diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestSpatialPrefixTree.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestSpatialPrefixTree.java index 84ce4bc136f..cf939cf54ff 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestSpatialPrefixTree.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestSpatialPrefixTree.java @@ -74,6 +74,7 @@ public class TestSpatialPrefixTree extends SpatialTestCase { assertTrue(prevNShape.getHeight() > sbox.getHeight()); } } + /** * A PrefixTree pruning optimization gone bad, applicable when optimize=true. See LUCENE-4770. diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BaseXYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BaseXYZSolid.java index ba92e358114..7b327aeb2da 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BaseXYZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/BaseXYZSolid.java @@ -25,13 +25,16 @@ abstract class BaseXYZSolid extends BasePlanetObject implements XYZSolid { /** Unit vector in x */ protected static final Vector xUnitVector = new Vector(1.0, 0.0, 0.0); + /** Unit vector in y */ protected static final Vector yUnitVector = new Vector(0.0, 1.0, 0.0); + /** Unit vector in z */ protected static final Vector zUnitVector = new Vector(0.0, 0.0, 1.0); /** Vertical plane normal to x unit vector passing through origin */ protected static final Plane xVerticalPlane = new Plane(0.0, 1.0, 0.0, 0.0); + /** Vertical plane normal to y unit vector passing through origin */ protected static final Plane yVerticalPlane = new Plane(1.0, 0.0, 0.0, 0.0); @@ -80,10 +83,13 @@ abstract class BaseXYZSolid extends BasePlanetObject implements XYZSolid { /** All edgepoints inside shape */ protected static final int ALL_INSIDE = 0; + /** Some edgepoints inside shape */ protected static final int SOME_INSIDE = 1; + /** No edgepoints inside shape */ protected static final int NONE_INSIDE = 2; + /** No edgepoints at all (means a shape that is the whole world) */ protected static final int NO_EDGEPOINTS = 3; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/DistanceStyle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/DistanceStyle.java index f5d9cb61b22..cdf2a6318aa 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/DistanceStyle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/DistanceStyle.java @@ -27,12 +27,16 @@ public interface DistanceStyle { /** Arc distance calculator */ public static final ArcDistance ARC = ArcDistance.INSTANCE; + /** Linear distance calculator */ public static final LinearDistance LINEAR = LinearDistance.INSTANCE; + /** Linear distance squared calculator */ public static final LinearSquaredDistance LINEAR_SQUARED = LinearSquaredDistance.INSTANCE; + /** Normal distance calculator */ public static final NormalDistance NORMAL = NormalDistance.INSTANCE; + /** Normal distance squared calculator */ public static final NormalSquaredDistance NORMAL_SQUARED = NormalSquaredDistance.INSTANCE; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoArea.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoArea.java index fe9954e7fb8..77a1d9ed0f6 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoArea.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoArea.java @@ -33,10 +33,13 @@ public interface GeoArea extends Membership { /** The referenced shape CONTAINS this area */ public static final int CONTAINS = 0; + /** The referenced shape IS WITHIN this area */ public static final int WITHIN = 1; + /** The referenced shape OVERLAPS this area */ public static final int OVERLAPS = 2; + /** The referenced shape has no relation to this area */ public static final int DISJOINT = 3; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java index f89a91f98b7..cca44c36d66 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseAreaShape.java @@ -35,8 +35,10 @@ abstract class GeoBaseAreaShape extends GeoBaseMembershipShape implements GeoAre /** All edgepoints inside shape */ protected static final int ALL_INSIDE = 0; + /** Some edgepoints inside shape */ protected static final int SOME_INSIDE = 1; + /** No edgepoints inside shape */ protected static final int NONE_INSIDE = 2; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java index d23566e43f8..70429716d88 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseCompositeAreaShape.java @@ -31,8 +31,10 @@ abstract class GeoBaseCompositeAreaShape /** All edgepoints inside shape */ protected static final int ALL_INSIDE = 0; + /** Some edgepoints inside shape */ protected static final int SOME_INSIDE = 1; + /** No edgepoints inside shape */ protected static final int NONE_INSIDE = 2; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java index 88db001880a..7890511501e 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java @@ -2305,11 +2305,13 @@ class GeoComplexPolygon extends GeoBasePolygon { * to numerical issues. */ private static final double DELTA_DISTANCE = Vector.MINIMUM_RESOLUTION; + /** * This is the maximum number of iterations. If we get this high, effectively the planes are * parallel, and we treat that as a crossing. */ private static final int MAX_ITERATIONS = 100; + /** * This is the amount off of the envelope plane that we count as "enough" for a valid crossing * assessment. diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java index 3b6e6904226..3b606b983bb 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java @@ -35,27 +35,37 @@ import org.apache.lucene.util.CollectionUtil; class GeoConcavePolygon extends GeoBasePolygon { /** The list of polygon points */ protected final List points; + /** A bitset describing, for each edge, whether it is internal or not */ protected final BitSet isInternalEdges; + /** The list of holes. If a point is in the hole, it is *not* in the polygon */ protected final List holes; /** A list of edges */ protected SidedPlane[] edges = null; + /** Start bounds */ protected SidedPlane[] startBounds = null; + /** End bounds */ protected SidedPlane[] endBounds = null; + /** A list of inverted edges */ protected SidedPlane[] invertedEdges = null; + /** The set of notable points for each edge */ protected GeoPoint[][] notableEdgePoints = null; + /** A point which is on the boundary of the polygon */ protected GeoPoint[] edgePoints = null; + /** Set to true when the polygon is complete */ protected boolean isDone = false; + /** Map from edge to its previous non-coplanar brother */ protected Map prevBrotherMap = null; + /** Map from edge to its next non-coplanar brother */ protected Map nextBrotherMap = null; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java index eed56793526..0cbe4120ed4 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java @@ -35,25 +35,34 @@ import org.apache.lucene.util.CollectionUtil; class GeoConvexPolygon extends GeoBasePolygon { /** The list of polygon points */ protected final List points; + /** A bitset describing, for each edge, whether it is internal or not */ protected final BitSet isInternalEdges; + /** The list of holes. If a point is in the hole, it is *not* in the polygon */ protected final List holes; /** A list of edges */ protected SidedPlane[] edges = null; + /** A list of edge starting bounding planes */ protected SidedPlane[] startBounds = null; + /** A list of edge ending bounding planes */ protected SidedPlane[] endBounds = null; + /** The set of notable points for each edge */ protected GeoPoint[][] notableEdgePoints = null; + /** A point which is on the boundary of the polygon */ protected GeoPoint[] edgePoints = null; + /** Set to true when the polygon is complete */ protected boolean isDone = false; + /** Map from edge to its previous non-coplanar brother */ protected Map prevBrotherMap = null; + /** Map from edge to its next non-coplanar brother */ protected Map nextBrotherMap = null; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateHorizontalLine.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateHorizontalLine.java index 1736f27380f..b22a5e5a4dc 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateHorizontalLine.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateHorizontalLine.java @@ -29,20 +29,25 @@ import java.io.OutputStream; class GeoDegenerateHorizontalLine extends GeoBaseBBox { /** Latitude of horizontal line */ protected final double latitude; + /** Left bounding longitude of line */ protected final double leftLon; + /** Right bounding longitude of line */ protected final double rightLon; /** Left hand endpoint of line */ protected final GeoPoint LHC; + /** Right hand endpoint of line */ protected final GeoPoint RHC; /** The plane describing the line */ protected final Plane plane; + /** The left side end plane */ protected final SidedPlane leftPlane; + /** The right side end plane */ protected final SidedPlane rightPlane; @@ -51,6 +56,7 @@ class GeoDegenerateHorizontalLine extends GeoBaseBBox { /** Center of line */ protected final GeoPoint centerPoint; + /** A point that's on the line */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLatitudeZone.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLatitudeZone.java index 002830b0617..c413d600149 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLatitudeZone.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLatitudeZone.java @@ -28,14 +28,19 @@ import java.io.OutputStream; class GeoDegenerateLatitudeZone extends GeoBaseBBox { /** The latitude */ protected final double latitude; + /** Sine of the latitude */ protected final double sinLatitude; + /** Plane describing the latitude zone */ protected final Plane plane; + /** A point on the world that's also on the zone */ protected final GeoPoint interiorPoint; + /** An array consisting of the interiorPoint */ protected final GeoPoint[] edgePoints; + /** No notable points */ protected static final GeoPoint[] planePoints = new GeoPoint[0]; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLongitudeSlice.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLongitudeSlice.java index 6f1703fa617..5cba2ec28c4 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLongitudeSlice.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateLongitudeSlice.java @@ -31,12 +31,16 @@ class GeoDegenerateLongitudeSlice extends GeoBaseBBox { /** The bounding plane for the slice (through both poles, perpendicular to the slice) */ protected final SidedPlane boundingPlane; + /** The plane of the slice */ protected final Plane plane; + /** A point on the slice */ protected final GeoPoint interiorPoint; + /** An array consisting of the one point chosen on the slice */ protected final GeoPoint[] edgePoints; + /** Notable points for the slice (north and south poles) */ protected final GeoPoint[] planePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java index eb3086f7f16..ff992e4dafa 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java @@ -39,6 +39,7 @@ class GeoDegeneratePath extends GeoBasePath { /** A list of SegmentEndpoints */ protected List endPoints; + /** A list of PathSegments */ protected List segments; @@ -404,8 +405,10 @@ class GeoDegeneratePath extends GeoBasePath { private static class SegmentEndpoint extends GeoBaseBounds { /** The center point of the endpoint */ public final GeoPoint point; + /** Pertinent cutoff planes from adjoining segments */ public final Membership[] cutoffPlanes; + /** Null membership */ public static final Membership[] NO_MEMBERSHIP = new Membership[0]; @@ -601,16 +604,22 @@ class GeoDegeneratePath extends GeoBasePath { private static class PathSegment extends GeoBaseBounds { /** Starting point of the segment */ public final GeoPoint start; + /** End point of the segment */ public final GeoPoint end; + /** Place to keep any complete segment distances we've calculated so far */ public final Map fullDistanceCache = new ConcurrentHashMap<>(1); + /** Normalized plane connecting the two points and going through world center */ public final Plane normalizedConnectingPlane; + /** Plane going through the center and start point, marking the start edge of the segment */ public final SidedPlane startCutoffPlane; + /** Plane going through the center and end point, marking the end edge of the segment */ public final SidedPlane endCutoffPlane; + /** Notable points for the connecting plane */ public final GeoPoint[] connectingPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java index 9040be0212e..25761bea1f7 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java @@ -28,6 +28,7 @@ import java.io.InputStream; class GeoDegeneratePoint extends GeoPoint implements GeoPointShape { /** Current planet model, since we don't extend BasePlanetObject */ protected final PlanetModel planetModel; + /** Edge point is an area containing just this */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateVerticalLine.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateVerticalLine.java index bf5256d5ca6..c760a6d735a 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateVerticalLine.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegenerateVerticalLine.java @@ -28,28 +28,37 @@ import java.io.OutputStream; public class GeoDegenerateVerticalLine extends GeoBaseBBox { /** Top latitude of the vertical line */ protected final double topLat; + /** Bottom latitude of the vertical line */ protected final double bottomLat; + /** Longitude of the vertical line */ protected final double longitude; /** Point at the upper end of the vertical line */ protected final GeoPoint UHC; + /** Point at the lower end of the vertical line */ protected final GeoPoint LHC; /** Top end cutoff plane */ protected final SidedPlane topPlane; + /** Bottom end cutoff plane */ protected final SidedPlane bottomPlane; + /** Back-side cutoff plane */ protected final SidedPlane boundingPlane; + /** The vertical line plane */ protected final Plane plane; + /** Notable points for the line (end points) */ protected final GeoPoint[] planePoints; + /** A computed center point for the line */ protected final GeoPoint centerPoint; + /** A point that's on the line */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java index c4ad8b8bcd3..1d089095b0b 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java @@ -34,12 +34,16 @@ import java.util.List; class GeoExactCircle extends GeoBaseCircle { /** Center of circle */ protected final GeoPoint center; + /** Radius of circle */ protected final double radius; + /** Actual accuracy */ protected final double actualAccuracy; + /** A point that is on the edge of the circle */ protected final GeoPoint[] edgePoints; + /** Slices of the circle */ protected final List circleSlices; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLatitudeZone.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLatitudeZone.java index c00e40ba42e..9be7e1d5382 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLatitudeZone.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLatitudeZone.java @@ -28,18 +28,25 @@ import java.io.OutputStream; class GeoLatitudeZone extends GeoBaseBBox { /** The top latitude of the zone */ protected final double topLat; + /** The bottom latitude of the zone */ protected final double bottomLat; + /** Cosine of the top lat */ protected final double cosTopLat; + /** Cosine of the bottom lat */ protected final double cosBottomLat; + /** The top plane */ protected final SidedPlane topPlane; + /** The bottom plane */ protected final SidedPlane bottomPlane; + /** An interior point */ protected final GeoPoint interiorPoint; + /** Notable points (none) */ protected static final GeoPoint[] planePoints = new GeoPoint[0]; @@ -49,8 +56,10 @@ class GeoLatitudeZone extends GeoBaseBBox { /** Top boundary point */ protected final GeoPoint topBoundaryPoint; + /** Bottom boundary point */ protected final GeoPoint bottomBoundaryPoint; + /** A point on each distinct edge */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLongitudeSlice.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLongitudeSlice.java index 22db1441419..1a5d7847c7a 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLongitudeSlice.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoLongitudeSlice.java @@ -29,18 +29,25 @@ import java.io.OutputStream; class GeoLongitudeSlice extends GeoBaseBBox { /** The left longitude of the slice */ protected final double leftLon; + /** The right longitude of the slice */ protected final double rightLon; + /** The left plane of the slice */ protected final SidedPlane leftPlane; + /** The right plane of the slice */ protected final SidedPlane rightPlane; + /** Backing plane (for narrow angles) */ protected final SidedPlane backingPlane; + /** The notable points for the slice (north and south poles) */ protected final GeoPoint[] planePoints; + /** The center point of the slice */ protected final GeoPoint centerPoint; + /** A point on the edge of the slice */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthLatitudeZone.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthLatitudeZone.java index bdf8d1fff07..7e6c7590576 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthLatitudeZone.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthLatitudeZone.java @@ -28,16 +28,22 @@ import java.io.OutputStream; class GeoNorthLatitudeZone extends GeoBaseBBox { /** The bottom latitude of the zone */ protected final double bottomLat; + /** Cosine of the bottom latitude of the zone */ protected final double cosBottomLat; + /** The bottom plane of the zone */ protected final SidedPlane bottomPlane; + /** An interior point of the zone */ protected final GeoPoint interiorPoint; + /** Notable points: none */ protected static final GeoPoint[] planePoints = new GeoPoint[0]; + /** A point on the bottom boundary */ protected final GeoPoint bottomBoundaryPoint; + /** A reference to the point on the boundary */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthRectangle.java index 20e93fbb1b4..ce2aa47dbc2 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoNorthRectangle.java @@ -30,32 +30,46 @@ import java.io.OutputStream; class GeoNorthRectangle extends GeoBaseBBox { /** The bottom latitude of the rectangle */ protected final double bottomLat; + /** The left longitude */ protected final double leftLon; + /** The right longitude */ protected final double rightLon; + /** Cosine of the middle latitude */ protected final double cosMiddleLat; + /** Lower right hand corner point */ protected final GeoPoint LRHC; + /** Lower left hand corner point */ protected final GeoPoint LLHC; + /** Bottom edge plane */ protected final SidedPlane bottomPlane; + /** Left-side plane */ protected final SidedPlane leftPlane; + /** Right-side plane */ protected final SidedPlane rightPlane; + /** Backing plane (for narrow angles) */ protected final SidedPlane backingPlane; + /** Bottom plane notable points */ protected final GeoPoint[] bottomPlanePoints; + /** Left plane notable points */ protected final GeoPoint[] leftPlanePoints; + /** Right plane notable points */ protected final GeoPoint[] rightPlanePoints; + /** Center point */ protected final GeoPoint centerPoint; + /** A point on the edge */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java index 72f7f0048a6..f2cb2ca5df8 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java @@ -37,11 +37,13 @@ public class GeoPoint extends Vector implements SerializableObject { * for thread safety, because depends wholly on immutable variables of this class. */ protected volatile double magnitude = Double.NEGATIVE_INFINITY; + /** * Lazily-evaluated latitude. Does not need to be synchronized for thread safety, because depends * wholly on immutable variables of this class. */ protected volatile double latitude = Double.NEGATIVE_INFINITY; + /** * Lazily-evaluated longitude. Does not need to be synchronized for thread safety, because depends * wholly on immutable variables of this class. diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java index 8f5da9ab3a9..29bb0889577 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPolygonFactory.java @@ -109,6 +109,7 @@ public class GeoPolygonFactory { public static class PolygonDescription { /** The list of points */ public final List points; + /** The list of holes */ public final List holes; @@ -1720,10 +1721,13 @@ public class GeoPolygonFactory { private static class Edge { /** Plane */ public final SidedPlane plane; + /** Start point */ public final GeoPoint startPoint; + /** End point */ public final GeoPoint endPoint; + /** Internal edge flag */ public final boolean isInternal; @@ -1761,8 +1765,10 @@ public class GeoPolygonFactory { private static class EdgeBufferIterator implements Iterator { /** Edge buffer */ protected final EdgeBuffer edgeBuffer; + /** First edge */ protected final Edge firstEdge; + /** Current edge */ protected Edge currentEdge; @@ -1804,10 +1810,13 @@ public class GeoPolygonFactory { private static class EdgeBuffer { /** Starting edge */ protected Edge oneEdge; + /** Full set of edges */ protected final Set edges = new HashSet<>(); + /** Map to previous edge */ protected final Map previousEdges = new HashMap<>(); + /** Map to next edge */ protected final Map nextEdges = new HashMap<>(); diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoRectangle.java index 6ef9ab08cdc..d6017e745a9 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoRectangle.java @@ -29,41 +29,55 @@ import java.io.OutputStream; class GeoRectangle extends GeoBaseBBox { /** The top latitude of the rect */ protected final double topLat; + /** The bottom latitude of the rect */ protected final double bottomLat; + /** The left longitude of the rect */ protected final double leftLon; + /** The right longitude of the rect */ protected final double rightLon; + /** The cosine of a middle latitude */ protected final double cosMiddleLat; /** The upper left hand corner point */ protected final GeoPoint ULHC; + /** The upper right hand corner point */ protected final GeoPoint URHC; + /** The lower right hand corner point */ protected final GeoPoint LRHC; + /** The lower left hand corner point */ protected final GeoPoint LLHC; /** The top plane */ protected final SidedPlane topPlane; + /** The bottom plane */ protected final SidedPlane bottomPlane; + /** The left plane */ protected final SidedPlane leftPlane; + /** The right plane */ protected final SidedPlane rightPlane; + /** Backing plane (for narrow angles) */ protected final SidedPlane backingPlane; /** Notable points for the top plane */ protected final GeoPoint[] topPlanePoints; + /** Notable points for the bottom plane */ protected final GeoPoint[] bottomPlanePoints; + /** Notable points for the left plane */ protected final GeoPoint[] leftPlanePoints; + /** Notable points for the right plane */ protected final GeoPoint[] rightPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoS2Shape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoS2Shape.java index 6e0347de0b8..728f61af07e 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoS2Shape.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoS2Shape.java @@ -31,28 +31,37 @@ class GeoS2Shape extends GeoBasePolygon { /** The first point */ protected final GeoPoint point1; + /** The second point */ protected final GeoPoint point2; + /** The third point */ protected final GeoPoint point3; + /** The fourth point */ protected final GeoPoint point4; /** The first plane */ protected final SidedPlane plane1; + /** The second plane */ protected final SidedPlane plane2; + /** The third plane */ protected final SidedPlane plane3; + /** The fourth plane */ protected final SidedPlane plane4; /** Notable points for the first plane */ protected final GeoPoint[] plane1Points; + /** Notable points for second plane */ protected final GeoPoint[] plane2Points; + /** Notable points for third plane */ protected final GeoPoint[] plane3Points; + /** Notable points for fourth plane */ protected final GeoPoint[] plane4Points; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthLatitudeZone.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthLatitudeZone.java index cfb44d1ad48..ce98ddc6a42 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthLatitudeZone.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthLatitudeZone.java @@ -28,16 +28,22 @@ import java.io.OutputStream; class GeoSouthLatitudeZone extends GeoBaseBBox { /** The top latitude of the zone */ protected final double topLat; + /** The cosine of the top latitude of the zone */ protected final double cosTopLat; + /** The top plane of the zone */ protected final SidedPlane topPlane; + /** An interior point of the zone */ protected final GeoPoint interiorPoint; + /** Notable points for the plane (none) */ protected static final GeoPoint[] planePoints = new GeoPoint[0]; + /** A point on the top boundary */ protected final GeoPoint topBoundaryPoint; + /** Edge points; a reference to the topBoundaryPoint */ protected final GeoPoint[] edgePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthRectangle.java index 75faaf88c17..41121215898 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoSouthRectangle.java @@ -30,30 +30,40 @@ import java.io.OutputStream; class GeoSouthRectangle extends GeoBaseBBox { /** The top latitude of the rect */ protected final double topLat; + /** The left longitude of the rect */ protected final double leftLon; + /** The right longitude of the rect */ protected final double rightLon; + /** The cosine of a middle latitude */ protected final double cosMiddleLat; + /** The upper left hand corner of the rectangle */ protected final GeoPoint ULHC; + /** The upper right hand corner of the rectangle */ protected final GeoPoint URHC; /** The top plane */ protected final SidedPlane topPlane; + /** The left plane */ protected final SidedPlane leftPlane; + /** The right plane */ protected final SidedPlane rightPlane; + /** Backing plane (for narrow angles) */ protected final SidedPlane backingPlane; /** Notable points for the top plane */ protected final GeoPoint[] topPlanePoints; + /** Notable points for the left plane */ protected final GeoPoint[] leftPlanePoints; + /** Notable points for the right plane */ protected final GeoPoint[] rightPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardCircle.java index adb9e734d7a..6a0aa4d123e 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardCircle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardCircle.java @@ -30,12 +30,16 @@ import java.io.OutputStream; class GeoStandardCircle extends GeoBaseCircle { /** Center of circle */ protected final GeoPoint center; + /** Cutoff angle of circle (not quite the same thing as radius) */ protected final double cutoffAngle; + /** The plane describing the circle (really an ellipse on a non-spherical world) */ protected final SidedPlane circlePlane; + /** A point that is on the world and on the circle plane */ protected final GeoPoint[] edgePoints; + /** Notable points for a circle -- there aren't any */ protected static final GeoPoint[] circlePoints = new GeoPoint[0]; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java index 250387d275c..b4676bce400 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java @@ -38,6 +38,7 @@ class GeoStandardPath extends GeoBasePath { /** Sine of cutoff angle */ protected final double sinAngle; + /** Cosine of cutoff angle */ protected final double cosAngle; @@ -837,8 +838,10 @@ class GeoStandardPath extends GeoBasePath { private static class BaseSegmentEndpoint extends GeoBaseBounds implements SegmentEndpoint { /** The previous path element */ protected final PathComponent previous; + /** The center point of the endpoint */ protected final GeoPoint point; + /** Null membership */ protected static final Membership[] NO_MEMBERSHIP = new Membership[0]; @@ -996,6 +999,7 @@ class GeoStandardPath extends GeoBasePath { private static class CircleSegmentEndpoint extends BaseSegmentEndpoint { /** A plane describing the circle */ protected final SidedPlane circlePlane; + /** No notable points from the circle itself */ protected static final GeoPoint[] circlePoints = new GeoPoint[0]; @@ -1090,6 +1094,7 @@ class GeoStandardPath extends GeoBasePath { /** Pertinent cutoff plane from adjoining segments */ protected final Membership[] cutoffPlanes; + /** Notable points for this segment endpoint */ private final GeoPoint[] notablePoints; @@ -1202,12 +1207,16 @@ class GeoStandardPath extends GeoBasePath { /** First circle */ protected final SidedPlane circlePlane1; + /** Second circle */ protected final SidedPlane circlePlane2; + /** Notable points for first circle */ protected final GeoPoint[] notablePoints1; + /** Notable points for second circle */ protected final GeoPoint[] notablePoints2; + /** Both cutoff planes are included here */ protected final Membership[] cutoffPlanes; @@ -1366,32 +1375,46 @@ class GeoStandardPath extends GeoBasePath { private static class PathSegment extends GeoBaseBounds implements PathComponent { /** Previous path component */ public final PathComponent previous; + /** Starting point of the segment */ public final GeoPoint start; + /** End point of the segment */ public final GeoPoint end; + /** Place to keep any complete segment distances we've calculated so far */ public final Map startDistanceCache = new ConcurrentHashMap<>(1); + /** Normalized plane connecting the two points and going through world center */ public final Plane normalizedConnectingPlane; + /** Cutoff plane parallel to connecting plane representing one side of the path segment */ public final SidedPlane upperConnectingPlane; + /** Cutoff plane parallel to connecting plane representing the other side of the path segment */ public final SidedPlane lowerConnectingPlane; + /** Plane going through the center and start point, marking the start edge of the segment */ public final SidedPlane startCutoffPlane; + /** Plane going through the center and end point, marking the end edge of the segment */ public final SidedPlane endCutoffPlane; + /** Upper right hand corner of segment */ public final GeoPoint URHC; + /** Lower right hand corner of segment */ public final GeoPoint LRHC; + /** Upper left hand corner of segment */ public final GeoPoint ULHC; + /** Lower left hand corner of segment */ public final GeoPoint LLHC; + /** Notable points for the upper connecting plane */ public final GeoPoint[] upperConnectingPlanePoints; + /** Notable points for the lower connecting plane */ public final GeoPoint[] lowerConnectingPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideDegenerateHorizontalLine.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideDegenerateHorizontalLine.java index d1bb6edcf99..b33f031cd3e 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideDegenerateHorizontalLine.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideDegenerateHorizontalLine.java @@ -28,20 +28,25 @@ import java.io.OutputStream; class GeoWideDegenerateHorizontalLine extends GeoBaseBBox { /** The latitude of the line */ protected final double latitude; + /** The left longitude cutoff of the line */ protected final double leftLon; + /** The right longitude cutoff of the line */ protected final double rightLon; /** The left end of the line */ protected final GeoPoint LHC; + /** The right end of the line */ protected final GeoPoint RHC; /** The plane the line is in */ protected final Plane plane; + /** The left cutoff plane */ protected final SidedPlane leftPlane; + /** The right cutoff plane */ protected final SidedPlane rightPlane; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java index 4089b8ffe14..d009c17da0c 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java @@ -28,11 +28,13 @@ import java.io.OutputStream; class GeoWideLongitudeSlice extends GeoBaseBBox { /** The left longitude */ protected final double leftLon; + /** The right longitude */ protected final double rightLon; /** The left plane */ protected final SidedPlane leftPlane; + /** The right plane */ protected final SidedPlane rightPlane; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java index 8f99b06fcc1..ffc19562819 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java @@ -28,8 +28,10 @@ import java.io.OutputStream; class GeoWideNorthRectangle extends GeoBaseBBox { /** Bottom latitude */ protected final double bottomLat; + /** Left longitude */ protected final double leftLon; + /** Right longitude */ protected final double rightLon; @@ -38,20 +40,25 @@ class GeoWideNorthRectangle extends GeoBaseBBox { /** The lower right hand corner point */ protected final GeoPoint LRHC; + /** The lower left hand corner point */ protected final GeoPoint LLHC; /** The bottom plane */ protected final SidedPlane bottomPlane; + /** The left plane */ protected final SidedPlane leftPlane; + /** The right plane */ protected final SidedPlane rightPlane; /** Notable points for the bottom plane */ protected final GeoPoint[] bottomPlanePoints; + /** Notable points for the left plane */ protected final GeoPoint[] leftPlanePoints; + /** Notable points for the right plane */ protected final GeoPoint[] rightPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideRectangle.java index e6f9a0d93fe..41dbab81b9c 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideRectangle.java @@ -32,10 +32,13 @@ class GeoWideRectangle extends GeoBaseBBox { /** The top latitude */ protected final double topLat; + /** The bottom latitude */ protected final double bottomLat; + /** The left longitude */ protected final double leftLon; + /** The right longitude */ protected final double rightLon; @@ -44,28 +47,37 @@ class GeoWideRectangle extends GeoBaseBBox { /** Upper left hand corner point */ protected final GeoPoint ULHC; + /** Lower right hand corner point */ protected final GeoPoint URHC; + /** Lower right hand corner point */ protected final GeoPoint LRHC; + /** Lower left hand corner point */ protected final GeoPoint LLHC; /** Top plane */ protected final SidedPlane topPlane; + /** Bottom plane */ protected final SidedPlane bottomPlane; + /** Left plane */ protected final SidedPlane leftPlane; + /** Right plane */ protected final SidedPlane rightPlane; /** Top plane's notable points */ protected final GeoPoint[] topPlanePoints; + /** Bottom plane's notable points */ protected final GeoPoint[] bottomPlanePoints; + /** Left plane's notable points */ protected final GeoPoint[] leftPlanePoints; + /** Right plane's notable points */ protected final GeoPoint[] rightPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java index 7ccc258697d..01c5d1a85a2 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java @@ -28,8 +28,10 @@ import java.io.OutputStream; class GeoWideSouthRectangle extends GeoBaseBBox { /** Top latitude of rect */ protected final double topLat; + /** Left longitude of rect */ protected final double leftLon; + /** Right longitude of rect */ protected final double rightLon; @@ -38,20 +40,25 @@ class GeoWideSouthRectangle extends GeoBaseBBox { /** Upper left hand corner */ protected final GeoPoint ULHC; + /** Upper right hand corner */ protected final GeoPoint URHC; /** The top plane */ protected final SidedPlane topPlane; + /** The left plane */ protected final SidedPlane leftPlane; + /** The right plane */ protected final SidedPlane rightPlane; /** Notable points for top plane */ protected final GeoPoint[] topPlanePoints; + /** Notable points for left plane */ protected final GeoPoint[] leftPlanePoints; + /** Notable points for right plane */ protected final GeoPoint[] rightPlanePoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWorld.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWorld.java index b1dd4646019..ac9bb2ce335 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWorld.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWorld.java @@ -28,6 +28,7 @@ import java.io.OutputStream; class GeoWorld extends GeoBaseBBox { /** No points on the edge of the shape */ protected static final GeoPoint[] edgePoints = new GeoPoint[0]; + /** Point in the middle of the world */ protected final GeoPoint originPoint; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/LatLonBounds.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/LatLonBounds.java index 3a7d6913268..1041bf7bb46 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/LatLonBounds.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/LatLonBounds.java @@ -25,13 +25,16 @@ public class LatLonBounds implements Bounds { /** Set to true if no longitude bounds can be stated */ private boolean noLongitudeBound = false; + /** Set to true if no top latitude bound can be stated */ private boolean noTopLatitudeBound = false; + /** Set to true if no bottom latitude bound can be stated */ private boolean noBottomLatitudeBound = false; /** If non-null, the minimum latitude bound */ private Double minLatitude = null; + /** If non-null, the maximum latitude bound */ private Double maxLatitude = null; @@ -94,6 +97,7 @@ public class LatLonBounds implements Bounds { /** If non-null, the left longitude bound */ private Double leftLongitude = null; + /** If non-null, the right longitude bound */ private Double rightLongitude = null; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java index f451a22f28e..9fb03ad7a1d 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java @@ -26,12 +26,16 @@ package org.apache.lucene.spatial3d.geom; public class Plane extends Vector { /** An array with no points in it */ public static final GeoPoint[] NO_POINTS = new GeoPoint[0]; + /** An array with no bounds in it */ public static final Membership[] NO_BOUNDS = new Membership[0]; + /** A vertical plane normal to the Y axis */ public static final Plane normalYPlane = new Plane(0.0, 1.0, 0.0, 0.0); + /** A vertical plane normal to the X axis */ public static final Plane normalXPlane = new Plane(1.0, 0.0, 0.0, 0.0); + /** A vertical plane normal to the Z axis */ public static final Plane normalZPlane = new Plane(0.0, 0.0, 1.0, 0.0); diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java index eb66ae973fd..df022ab71b5 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java @@ -44,32 +44,45 @@ public class PlanetModel implements SerializableObject { // instead. /** Semi-major axis */ public final double a; + /** Semi-minor axis */ public final double b; + /** The x/y scaling factor */ public final double xyScaling; + /** The z scaling factor */ public final double zScaling; + /** The inverse of xyScaling */ public final double inverseXYScaling; + /** The inverse of zScaling */ public final double inverseZScaling; + /** The square of the inverse of xyScaling */ public final double inverseXYScalingSquared; + /** The square of the inverse of zScaling */ public final double inverseZScalingSquared; + /** The scaled flattening value */ public final double scaledFlattening; + /** The square ratio */ public final double squareRatio; + /** The mean radius of the planet */ // Computed as (2a + b) / 3 from: "Geodetic Reference System 1980" by H. Moritz // ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf public final double meanRadius; + /** The scale of the planet */ public final double scale; + /** The inverse of scale */ public final double inverseScale; + /** The mean radius of the planet model */ // We do NOT include radius, because all computations in geo3d are in radians, not meters. @@ -78,32 +91,44 @@ public class PlanetModel implements SerializableObject { /** North pole */ public final GeoPoint NORTH_POLE; + /** South pole */ public final GeoPoint SOUTH_POLE; + /** Min X pole */ public final GeoPoint MIN_X_POLE; + /** Max X pole */ public final GeoPoint MAX_X_POLE; + /** Min Y pole */ public final GeoPoint MIN_Y_POLE; + /** Max Y pole */ public final GeoPoint MAX_Y_POLE; + /** Minimum surface distance between poles */ public final double minimumPoleDistance; // ENCODING / DECODING CONSTANTS /** bit space for integer encoding */ private static final int BITS = 32; + /** maximum magnitude value for *this* planet model */ public final double MAX_VALUE; + /** numeric space (buckets) for mapping double values into integer range */ private final double MUL; + /** scalar value used to decode from integer back into double space */ public final double DECODE; + /** Max encoded value */ public final int MAX_ENCODED_VALUE; + /** Min encoded value */ public final int MIN_ENCODED_VALUE; + /** utility class used to encode/decode from lat/lon (decimal degrees) into doc value integers */ public final DocValueEncoder docValueEncoder; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardObjects.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardObjects.java index 707845df8f5..e0279b38d85 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardObjects.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardObjects.java @@ -29,6 +29,7 @@ class StandardObjects { /** Registry of standard classes to corresponding code */ static Map, Integer> classRegsitry = new HashMap<>(); + /** Registry of codes to corresponding classes */ static Map> codeRegsitry = new HashMap<>(); diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardXYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardXYZSolid.java index c55c9e3e5cf..3106ce9f3f1 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardXYZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/StandardXYZSolid.java @@ -29,42 +29,58 @@ class StandardXYZSolid extends BaseXYZSolid { /** Min-X */ protected final double minX; + /** Max-X */ protected final double maxX; + /** Min-Y */ protected final double minY; + /** Max-Y */ protected final double maxY; + /** Min-Z */ protected final double minZ; + /** Max-Z */ protected final double maxZ; /** Whole world? */ protected final boolean isWholeWorld; + /** Min-X plane */ protected final SidedPlane minXPlane; + /** Max-X plane */ protected final SidedPlane maxXPlane; + /** Min-Y plane */ protected final SidedPlane minYPlane; + /** Max-Y plane */ protected final SidedPlane maxYPlane; + /** Min-Z plane */ protected final SidedPlane minZPlane; + /** Max-Z plane */ protected final SidedPlane maxZPlane; /** true if minXPlane intersects globe */ protected final boolean minXPlaneIntersects; + /** true if maxXPlane intersects globe */ protected final boolean maxXPlaneIntersects; + /** true if minYPlane intersects globe */ protected final boolean minYPlaneIntersects; + /** true if maxYPlane intersects globe */ protected final boolean maxYPlaneIntersects; + /** true if minZPlane intersects globe */ protected final boolean minZPlaneIntersects; + /** true if maxZPlane intersects globe */ protected final boolean maxZPlaneIntersects; @@ -78,14 +94,19 @@ class StandardXYZSolid extends BaseXYZSolid { /** Notable points for minXPlane */ protected final GeoPoint[] notableMinXPoints; + /** Notable points for maxXPlane */ protected final GeoPoint[] notableMaxXPoints; + /** Notable points for minYPlane */ protected final GeoPoint[] notableMinYPoints; + /** Notable points for maxYPlane */ protected final GeoPoint[] notableMaxYPoints; + /** Notable points for minZPlane */ protected final GeoPoint[] notableMinZPoints; + /** Notable points for maxZPlane */ protected final GeoPoint[] notableMaxZPoints; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java index b0b15c8fac8..719acd65801 100755 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java @@ -24,18 +24,23 @@ package org.apache.lucene.spatial3d.geom; public class Vector { /** Values that are all considered to be essentially zero have a magnitude less than this. */ public static final double MINIMUM_RESOLUTION = 1.0e-12; + /** Angular version of minimum resolution. */ public static final double MINIMUM_ANGULAR_RESOLUTION = Math.PI * MINIMUM_RESOLUTION; + /** For squared quantities, the bound is squared too. */ public static final double MINIMUM_RESOLUTION_SQUARED = MINIMUM_RESOLUTION * MINIMUM_RESOLUTION; + /** For cubed quantities, cube the bound. */ public static final double MINIMUM_RESOLUTION_CUBED = MINIMUM_RESOLUTION_SQUARED * MINIMUM_RESOLUTION; /** The x value */ public final double x; + /** The y value */ public final double y; + /** The z value */ public final double z; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZBounds.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZBounds.java index d277014a664..5dd16bf0d02 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZBounds.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYZBounds.java @@ -34,14 +34,19 @@ public class XYZBounds implements Bounds { /** Minimum x */ private Double minX = null; + /** Maximum x */ private Double maxX = null; + /** Minimum y */ private Double minY = null; + /** Maximum y */ private Double maxY = null; + /** Minimum z */ private Double minZ = null; + /** Maximum z */ private Double maxZ = null; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYdZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYdZSolid.java index 2a0079bfa46..7f9ca51fa01 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYdZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XYdZSolid.java @@ -29,23 +29,31 @@ class XYdZSolid extends BaseXYZSolid { /** Min-X */ protected final double minX; + /** Max-X */ protected final double maxX; + /** Min-Y */ protected final double minY; + /** Max-Y */ protected final double maxY; + /** Z */ protected final double Z; /** Min-X plane */ protected final SidedPlane minXPlane; + /** Max-X plane */ protected final SidedPlane maxXPlane; + /** Min-Y plane */ protected final SidedPlane minYPlane; + /** Max-Y plane */ protected final SidedPlane maxYPlane; + /** Z plane */ protected final Plane zPlane; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYZSolid.java index b24aaf2a790..c584d2c61e9 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYZSolid.java @@ -29,23 +29,31 @@ class XdYZSolid extends BaseXYZSolid { /** Min-X */ protected final double minX; + /** Max-X */ protected final double maxX; + /** Y */ protected final double Y; + /** Min-Z */ protected final double minZ; + /** Max-Z */ protected final double maxZ; /** Min-X plane */ protected final SidedPlane minXPlane; + /** Max-X plane */ protected final SidedPlane maxXPlane; + /** Y plane */ protected final Plane yPlane; + /** Min-Z plane */ protected final SidedPlane minZPlane; + /** Max-Z plane */ protected final SidedPlane maxZPlane; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYdZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYdZSolid.java index 8e17742524b..243cb2ce55f 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYdZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/XdYdZSolid.java @@ -30,10 +30,13 @@ class XdYdZSolid extends BaseXYZSolid { /** Min-X */ protected final double minX; + /** Max-X */ protected final double maxX; + /** Y */ protected final double Y; + /** Z */ protected final double Z; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYZSolid.java index dbc5af474c8..fa4e2c63253 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYZSolid.java @@ -29,23 +29,31 @@ class dXYZSolid extends BaseXYZSolid { /** X */ protected final double X; + /** Min-Y */ protected final double minY; + /** Max-Y */ protected final double maxY; + /** Min-Z */ protected final double minZ; + /** Max-Z */ protected final double maxZ; /** X plane */ protected final Plane xPlane; + /** Min-Y plane */ protected final SidedPlane minYPlane; + /** Max-Y plane */ protected final SidedPlane maxYPlane; + /** Min-Z plane */ protected final SidedPlane minZPlane; + /** Max-Z plane */ protected final SidedPlane maxZPlane; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYdZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYdZSolid.java index 0350f22e41e..ab093bf1753 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYdZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXYdZSolid.java @@ -30,10 +30,13 @@ class dXYdZSolid extends BaseXYZSolid { /** X */ protected final double X; + /** Min-Y */ protected final double minY; + /** Max-Y */ protected final double maxY; + /** Z */ protected final double Z; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYZSolid.java index 45f399a4283..1d6b0439a57 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYZSolid.java @@ -30,10 +30,13 @@ class dXdYZSolid extends BaseXYZSolid { /** X */ protected final double X; + /** Y */ protected final double Y; + /** Min-Z */ protected final double minZ; + /** Max-Z */ protected final double maxZ; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYdZSolid.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYdZSolid.java index 9cd5924da47..59512841923 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYdZSolid.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/dXdYdZSolid.java @@ -29,13 +29,16 @@ class dXdYdZSolid extends BaseXYZSolid { /** X */ protected final double X; + /** Y */ protected final double Y; + /** Z */ protected final double Z; /** On surface? */ protected final boolean isOnSurface; + /** The point */ protected final GeoPoint thePoint; diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java index 0000a96c823..ef01eb16251 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/Geo3DUtil.java @@ -20,6 +20,7 @@ class Geo3DUtil { /** How many radians are in one degree */ static final double RADIANS_PER_DEGREE = Math.PI / 180.0; + /** How many degrees in a radian */ static final double DEGREES_PER_RADIAN = 180.0 / Math.PI; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/spell/CombineSuggestion.java b/lucene/suggest/src/java/org/apache/lucene/search/spell/CombineSuggestion.java index 49738b3fde3..72cefcf5b73 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/spell/CombineSuggestion.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/spell/CombineSuggestion.java @@ -20,6 +20,7 @@ package org.apache.lucene.search.spell; public class CombineSuggestion { /** The indexes from the passed-in array of terms used to make this word combination */ public final int[] originalTermIndexes; + /** The word combination suggestion */ public final SuggestWord suggestion; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java b/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java index d8d75e26763..38cc90c61cc 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java @@ -59,30 +59,40 @@ public class DirectSpellChecker { /** maximum edit distance for candidate terms */ private int maxEdits = LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE; + /** minimum prefix for candidate terms */ private int minPrefix = 1; + /** maximum number of top-N inspections per suggestion */ private int maxInspections = 5; + /** minimum accuracy for a term to match */ private float accuracy = SpellChecker.DEFAULT_ACCURACY; + /** * value in [0..1] (or absolute number >= 1) representing the minimum number of documents (of * the total) where a term should appear. */ private float thresholdFrequency = 0f; + /** minimum length of a query word to return suggestions */ private int minQueryLength = 4; + /** maximum length of a query word to return suggestions */ private int maxQueryLength = Integer.MAX_VALUE; + /** * value in [0..1] (or absolute number >= 1) representing the maximum number of documents (of * the total) a query term can appear in to be corrected. */ private float maxQueryFrequency = 0.01f; + /** true if the spellchecker should lowercase terms */ private boolean lowerCaseTerms = true; + /** the comparator to use */ private Comparator comparator = SuggestWordQueue.DEFAULT_COMPARATOR; + /** the string distance to use */ private StringDistance distance = INTERNAL_LEVENSHTEIN; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java b/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java index aa91c2af904..60202bcb10a 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java @@ -74,6 +74,7 @@ public class SpellChecker implements java.io.Closeable { // don't modify the directory directly - see #swapSearcher() // TODO: why is this package private? Directory spellIndex; + /** Boost value for start and end grams */ private float bStart = 2.0f; @@ -113,6 +114,7 @@ public class SpellChecker implements java.io.Closeable { public SpellChecker(Directory spellIndex, StringDistance sd) throws IOException { this(spellIndex, sd, SuggestWordQueue.DEFAULT_COMPARATOR); } + /** * Use the given directory as a spell checker index with a {@link LevenshteinDistance} as the * default {@link StringDistance}. The directory is created if it doesn't exist yet. @@ -189,6 +191,7 @@ public class SpellChecker implements java.io.Closeable { public void setStringDistance(StringDistance sd) { this.sd = sd; } + /** * Returns the {@link StringDistance} instance used by this {@link SpellChecker} instance. * @@ -408,6 +411,7 @@ public class SpellChecker implements java.io.Closeable { releaseSearcher(indexSearcher); } } + /** Add a clause to a boolean query. */ private static void add(BooleanQuery.Builder q, String name, String value, float boost) { Query tq = new TermQuery(new Term(name, value)); diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/BufferedInputIterator.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/BufferedInputIterator.java index 7084eba13f9..dff8ea9efc3 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/BufferedInputIterator.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/BufferedInputIterator.java @@ -35,12 +35,16 @@ public class BufferedInputIterator implements InputIterator { // TODO keep this for now /** buffered term entries */ protected BytesRefArray entries = new BytesRefArray(Counter.newCounter()); + /** buffered payload entries */ protected BytesRefArray payloads = new BytesRefArray(Counter.newCounter()); + /** buffered context set entries */ protected List> contextSets = new ArrayList<>(); + /** current buffer position */ protected int curPos = -1; + /** buffered weights, parallel with {@link #entries} */ protected long[] freqs = new long[1]; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java index 0c34d96485e..2619bce7290 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java @@ -52,6 +52,7 @@ public class DocumentDictionary implements Dictionary { /** Field to read payload from */ protected final String payloadField; + /** Field to read contexts from */ protected final String contextsField; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java index 53b7458723d..abe2a1da32b 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java @@ -96,10 +96,13 @@ public class DocumentValueSourceDictionary extends DocumentDictionary { final class DocumentValueSourceInputIterator extends DocumentDictionary.DocumentInputIterator { private LongValues currentWeightValues; + /** leaves of the reader */ private final List leaves; + /** starting docIds of all the leaves */ private final int[] starts; + /** current leave index */ private int currentLeafIndex = 0; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/UnsortedInputIterator.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/UnsortedInputIterator.java index 3ce5eb65441..632115deb0c 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/UnsortedInputIterator.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/UnsortedInputIterator.java @@ -33,6 +33,7 @@ public class UnsortedInputIterator extends BufferedInputIterator { private int currentOrd = -1; private final BytesRefBuilder spare = new BytesRefBuilder(); private final BytesRefBuilder payloadSpare = new BytesRefBuilder(); + /** * Creates a new iterator, wrapping the specified iterator and returning elements in a random * order. diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java index 77a92c3217f..26a434f8291 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java @@ -116,6 +116,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable { /** Analyzer used at search time */ protected final Analyzer queryAnalyzer; + /** Analyzer used at index time */ protected final Analyzer indexAnalyzer; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/SuggestStopFilterFactory.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/SuggestStopFilterFactory.java index 42bdffe8d74..9d8f6c189b6 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/SuggestStopFilterFactory.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/SuggestStopFilterFactory.java @@ -74,6 +74,7 @@ public class SuggestStopFilterFactory extends TokenFilterFactory implements Reso /** the default format, one word per line, whole line comments start with "#" */ public static final String FORMAT_WORDSET = "wordset"; + /** multiple words may be specified on each line, trailing comments start with "|" */ public static final String FORMAT_SNOWBALL = "snowball"; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionsTermsReader.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionsTermsReader.java index 6313c020d6c..9aac363b2d0 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionsTermsReader.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionsTermsReader.java @@ -31,8 +31,10 @@ import org.apache.lucene.util.Accountable; public final class CompletionsTermsReader implements Accountable { /** Minimum entry weight for the suggester */ public final long minWeight; + /** Maximum entry weight for the suggester */ public final long maxWeight; + /** type of suggester (context-enabled or not) */ public final byte type; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/ContextQuery.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/ContextQuery.java index f495ef7802c..924f8d91ab6 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/ContextQuery.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/ContextQuery.java @@ -76,6 +76,7 @@ public class ContextQuery extends CompletionQuery implements Accountable { private IntsRefBuilder scratch = new IntsRefBuilder(); private Map contexts; private boolean matchAllContexts = false; + /** Inner completion query */ protected CompletionQuery innerQuery; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/PrefixCompletionQuery.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/PrefixCompletionQuery.java index 1d10d8bcf1c..09b1f0b19cd 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/PrefixCompletionQuery.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/PrefixCompletionQuery.java @@ -80,6 +80,7 @@ public class PrefixCompletionQuery extends CompletionQuery { public void visit(QueryVisitor visitor) { visitor.visitLeaf(this); } + /** Gets the analyzer used to analyze the prefix. */ public Analyzer getAnalyzer() { return analyzer; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/RegexCompletionQuery.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/RegexCompletionQuery.java index 7ee27bb0d1d..d3cc80623a7 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/RegexCompletionQuery.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/RegexCompletionQuery.java @@ -60,6 +60,7 @@ public class RegexCompletionQuery extends CompletionQuery { public RegexCompletionQuery(Term term, BitsProducer filter) { this(term, RegExp.ALL, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT, filter); } + /** * Calls {@link RegexCompletionQuery#RegexCompletionQuery(Term, int, int, BitsProducer)} with no * filter diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java index 8bccc344b50..28d117d1279 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java @@ -51,6 +51,7 @@ public class FSTCompletion { public static final class Completion implements Comparable { /** UTF-8 bytes of the suggestion */ public final BytesRef utf8; + /** source bucket (weight) of the suggestion */ public final int bucket; diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java index e0326378532..6bbba74641b 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java @@ -23,17 +23,22 @@ public class TernaryTreeNode { /** Creates a new empty node */ public TernaryTreeNode() {} + /** the character stored by a node. */ char splitchar; + /** a reference object to the node containing character smaller than this node's character. */ TernaryTreeNode loKid; + /** * a reference object to the node containing character next to this node's character as occurring * in the inserted token. */ TernaryTreeNode eqKid; + /** a reference object to the node containing character higher than this node's character. */ TernaryTreeNode hiKid; + /** * used by leaf nodes to store the complete tokens to be added to suggest list while * auto-completing the prefix. diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java index 9546e639373..c5e5bddf095 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java @@ -47,6 +47,7 @@ public class MockTokenizer extends Tokenizer { new CharacterRunAutomaton( Operations.determinize( new RegExp("[^ \t\r\n]+").toAutomaton(), Operations.DEFAULT_DETERMINIZE_WORK_LIMIT)); + /** * Acts Similar to KeywordTokenizer. TODO: Keyword returns an "empty" token for an empty reader... */ @@ -54,6 +55,7 @@ public class MockTokenizer extends Tokenizer { new CharacterRunAutomaton( Operations.determinize( new RegExp(".*").toAutomaton(), Operations.DEFAULT_DETERMINIZE_WORK_LIMIT)); + /** Acts like LetterTokenizer. */ // the ugly regex below is incomplete Unicode 5.2 [:Letter:] public static final CharacterRunAutomaton SIMPLE = diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java index d95979502ad..17a8e89f5d7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java @@ -299,6 +299,7 @@ public class EarthDebugger { angle += 360. / steps; } } + // craziness for plotting stuff :) private static double wrapLat(double lat) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java index 8dd618afd4a..4ed4c8dfeaa 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java @@ -525,6 +525,7 @@ public abstract class BaseMergePolicyTestCase extends LuceneTestCase { public static class IOStats { /** Bytes written through flushes. */ long flushBytesWritten; + /** Bytes written through merges. */ long mergeBytesWritten; } diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java index 76058d117af..b6cb3d2e11f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java @@ -60,6 +60,7 @@ public class MergingCodecReader extends FilterCodecReader { } } }; + // TODO: other formats too /** Wrap the given instance. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java index 9439a40de1c..25833c3c59d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java @@ -51,8 +51,10 @@ public abstract class FilterFileSystemProvider extends FileSystemProvider { /** The underlying {@code FileSystemProvider}. */ protected final FileSystemProvider delegate; + /** The underlying {@code FileSystem} instance. */ protected FilterFileSystem fileSystem; + /** The URI scheme for this provider. */ protected final String scheme; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java index 624ce4f0728..ebacd6a17b7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java @@ -38,6 +38,7 @@ public class WindowsFS extends HandleTrackingFS { // ownership for // the path we rename ie. hardlinks will still resolve to the same key final Map> openFiles = new HashMap<>(); + // TODO: try to make this as realistic as possible... it depends e.g. how you // open files, if you map them, etc, if you can delete them (Uwe knows the rules) diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java index 3f50989bcf9..d8f4aeca2e0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java @@ -96,8 +96,10 @@ public class RandomSimilarity extends PerFieldSimilarityWrapper { static BasicModel[] BASIC_MODELS = { new BasicModelG(), new BasicModelIF(), new BasicModelIn(), new BasicModelIne(), }; + /** The DFR aftereffects to test. */ static AfterEffect[] AFTER_EFFECTS = {new AfterEffectB(), new AfterEffectL()}; + /** The DFR normalizations to test. */ static Normalization[] NORMALIZATIONS = { new NormalizationH1(), new NormalizationH2(), @@ -106,10 +108,13 @@ public class RandomSimilarity extends PerFieldSimilarityWrapper { // a couple tests (e.g. TestDocBoost, TestSort) that expect length normalization // new Normalization.NoNormalization() }; + /** The distributions for IB. */ static Distribution[] DISTRIBUTIONS = {new DistributionLL(), new DistributionSPL()}; + /** Lambdas for IB. */ static Lambda[] LAMBDAS = {new LambdaDF(), new LambdaTTF()}; + /** Independence measures for DFI */ static Independence[] INDEPENDENCE_MEASURES = { new IndependenceStandardized(), new IndependenceSaturated(), new IndependenceChiSquared() diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java index bedfec04f3e..c658040a97d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java @@ -22,8 +22,10 @@ public final class TimeUnits { /** 1 second in milliseconds */ public static final int SECOND = 1000; + /** 1 minute in milliseconds */ public static final int MINUTE = 60 * SECOND; + /** 1 hour in milliseconds */ public static final int HOUR = 60 * MINUTE; } diff --git a/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java index fd5da371499..2cb190d4529 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java @@ -50,6 +50,7 @@ public class TestVerboseFS extends MockFileSystemTestCase { static class InfoStreamListener extends InfoStream { /** True if we saw the message */ final AtomicBoolean seenMessage = new AtomicBoolean(false); + /** Expected message */ final String messageStartsWith;