forked from apache/lucene-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix javadoc Harden TestVectorValues.testAddIndexesDirectory01 Resolve merge conflict Fix random TestVectorValues failures by use of forceMerge (and getOnlyLeafReader) LUCENE-9322: Make sure to account for vectors in SortingCodecReader. (apache#2028) LUCENE-9583: extract separate RandomAccessVectorValues interface (apache#2037) LUCENE-9322: fix minor cosmetic refactoring error in logging string in IndexWriter's infoStream logging. It was always printing 'vector values' for all merging times instead of the other parts of Lucene index ('doc values', 'stored fields', etc.) LUCENE-9322: Some fixes to SimpleTextVectorFormat. (apache#2071) * Make sure the file extensions are unique. * Fix bug in vector reading. LUCENE-9004: KNN vector search using NSW graphs (apache#2022) LUCENE-9610: fix TestKnnGraph.testMerge LUCENE-9610: fix bug in previous test fix Make Backward compatible
- Loading branch information
Michael Sokolov
authored and
Anand Kotriwal
committed
Dec 1, 2020
1 parent
76c62e1
commit 57a9022
Showing
91 changed files
with
7,385 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene87/Lucene87Codec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.lucene.codecs.lucene87; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.lucene.codecs.Codec; | ||
import org.apache.lucene.codecs.CompoundFormat; | ||
import org.apache.lucene.codecs.DocValuesFormat; | ||
import org.apache.lucene.codecs.FieldInfosFormat; | ||
import org.apache.lucene.codecs.FilterCodec; | ||
import org.apache.lucene.codecs.LiveDocsFormat; | ||
import org.apache.lucene.codecs.NormsFormat; | ||
import org.apache.lucene.codecs.PointsFormat; | ||
import org.apache.lucene.codecs.PostingsFormat; | ||
import org.apache.lucene.codecs.SegmentInfoFormat; | ||
import org.apache.lucene.codecs.StoredFieldsFormat; | ||
import org.apache.lucene.codecs.TermVectorsFormat; | ||
import org.apache.lucene.codecs.VectorFormat; | ||
import org.apache.lucene.codecs.lucene50.Lucene50CompoundFormat; | ||
import org.apache.lucene.codecs.lucene50.Lucene50LiveDocsFormat; | ||
import org.apache.lucene.codecs.lucene50.Lucene50TermVectorsFormat; | ||
import org.apache.lucene.codecs.lucene60.Lucene60FieldInfosFormat; | ||
import org.apache.lucene.codecs.lucene80.Lucene80NormsFormat; | ||
import org.apache.lucene.codecs.lucene84.Lucene84PostingsFormat; | ||
import org.apache.lucene.codecs.lucene86.Lucene86PointsFormat; | ||
import org.apache.lucene.codecs.lucene86.Lucene86SegmentInfoFormat; | ||
import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat; | ||
import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; | ||
|
||
/** | ||
* Implements the Lucene 8.6 index format, with configurable per-field postings | ||
* and docvalues formats. | ||
* <p> | ||
* If you want to reuse functionality of this codec in another codec, extend | ||
* {@link FilterCodec}. | ||
* | ||
* @see org.apache.lucene.codecs.lucene86 package documentation for file format details. | ||
* | ||
* @lucene.experimental | ||
*/ | ||
public class Lucene87Codec extends Codec { | ||
private final TermVectorsFormat vectorsFormat = new Lucene50TermVectorsFormat(); | ||
private final FieldInfosFormat fieldInfosFormat = new Lucene60FieldInfosFormat(); | ||
private final SegmentInfoFormat segmentInfosFormat = new Lucene86SegmentInfoFormat(); | ||
private final LiveDocsFormat liveDocsFormat = new Lucene50LiveDocsFormat(); | ||
private final CompoundFormat compoundFormat = new Lucene50CompoundFormat(); | ||
private final PointsFormat pointsFormat = new Lucene86PointsFormat(); | ||
private final PostingsFormat defaultFormat; | ||
|
||
private final PostingsFormat postingsFormat = new PerFieldPostingsFormat() { | ||
@Override | ||
public PostingsFormat getPostingsFormatForField(String field) { | ||
return Lucene87Codec.this.getPostingsFormatForField(field); | ||
} | ||
}; | ||
|
||
private final DocValuesFormat docValuesFormat = new PerFieldDocValuesFormat() { | ||
@Override | ||
public DocValuesFormat getDocValuesFormatForField(String field) { | ||
return Lucene87Codec.this.getDocValuesFormatForField(field); | ||
} | ||
}; | ||
|
||
private final StoredFieldsFormat storedFieldsFormat; | ||
|
||
/** | ||
* Instantiates a new codec. | ||
*/ | ||
public Lucene87Codec() { | ||
this(Lucene87StoredFieldsFormat.Mode.BEST_SPEED); | ||
} | ||
|
||
/** | ||
* Instantiates a new codec, specifying the stored fields compression | ||
* mode to use. | ||
* @param mode stored fields compression mode to use for newly | ||
* flushed/merged segments. | ||
*/ | ||
public Lucene87Codec(Lucene87StoredFieldsFormat.Mode mode) { | ||
super("Lucene87"); | ||
this.storedFieldsFormat = new Lucene87StoredFieldsFormat(Objects.requireNonNull(mode)); | ||
this.defaultFormat = new Lucene84PostingsFormat(); | ||
} | ||
|
||
@Override | ||
public final StoredFieldsFormat storedFieldsFormat() { | ||
return storedFieldsFormat; | ||
} | ||
|
||
@Override | ||
public final TermVectorsFormat termVectorsFormat() { | ||
return vectorsFormat; | ||
} | ||
|
||
@Override | ||
public final PostingsFormat postingsFormat() { | ||
return postingsFormat; | ||
} | ||
|
||
@Override | ||
public final FieldInfosFormat fieldInfosFormat() { | ||
return fieldInfosFormat; | ||
} | ||
|
||
@Override | ||
public final SegmentInfoFormat segmentInfoFormat() { | ||
return segmentInfosFormat; | ||
} | ||
|
||
@Override | ||
public final LiveDocsFormat liveDocsFormat() { | ||
return liveDocsFormat; | ||
} | ||
|
||
@Override | ||
public final CompoundFormat compoundFormat() { | ||
return compoundFormat; | ||
} | ||
|
||
@Override | ||
public final PointsFormat pointsFormat() { | ||
return pointsFormat; | ||
} | ||
|
||
@Override | ||
public final VectorFormat vectorFormat() { return VectorFormat.EMPTY; } | ||
|
||
/** Returns the postings format that should be used for writing | ||
* new segments of <code>field</code>. | ||
* | ||
* The default implementation always returns "Lucene84". | ||
* <p> | ||
* <b>WARNING:</b> if you subclass, you are responsible for index | ||
* backwards compatibility: future version of Lucene are only | ||
* guaranteed to be able to read the default implementation. | ||
*/ | ||
public PostingsFormat getPostingsFormatForField(String field) { | ||
return defaultFormat; | ||
} | ||
|
||
/** Returns the docvalues format that should be used for writing | ||
* new segments of <code>field</code>. | ||
* | ||
* The default implementation always returns "Lucene80". | ||
* <p> | ||
* <b>WARNING:</b> if you subclass, you are responsible for index | ||
* backwards compatibility: future version of Lucene are only | ||
* guaranteed to be able to read the default implementation. | ||
*/ | ||
public DocValuesFormat getDocValuesFormatForField(String field) { | ||
return defaultDVFormat; | ||
} | ||
|
||
@Override | ||
public final DocValuesFormat docValuesFormat() { | ||
return docValuesFormat; | ||
} | ||
|
||
private final DocValuesFormat defaultDVFormat = DocValuesFormat.forName("Lucene80"); | ||
|
||
private final NormsFormat normsFormat = new Lucene80NormsFormat(); | ||
|
||
@Override | ||
public final NormsFormat normsFormat() { | ||
return normsFormat; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene87/package.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | ||
</head> | ||
<body> | ||
Lucene 8.7 file format. | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.