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.
Merge branch 'enhancement_blockUnkwon-default-true' of github.com:Mar…
…cusSorealheis/lucene-solr into enhancement_blockUnkwon-default-true * 'enhancement_blockUnkwon-default-true' of github.com:MarcusSorealheis/lucene-solr: (37 commits) SOLR-13699 - maxChars no longer working on CopyField with javabin SOLR-13699 - maxChars no longer working on CopyField with Javabin SOLR-13655: Fix precommit SOLR-11601: Improve geodist error message when using with LLPSF. SOLR-13655: Added CHANGES entry SOLR-13655:Upgrade Collections.unModifiableSet to Set.of and Set.copyOf (apache#817) SOLR-13702: Fix precommit SOLR-13702: Some components register twice their metric names (apache#834) LUCENE-8952: Use a sort key instead of true distance in NearestNeighbor. (apache#832) SOLR-13707: API to expose the currently used package name, details for each plugin SOLR-13707: API to expose the currently used package name, details for each plugin (apache#841) Additional logging in test framework methods that 'waitFor' something to better trace order of operations when failures occur SOLR-13257: Support deterministic replica routing SOLR-13706: Config API output is broken for "highlight" component LUCENE-8755: Spatial-extras quad and packed-quad trees now index points a little faster, and also fix an edge case bug. Fixes apache#824 removed unnecessary comments SOLR-13650: AwaitsFix TestContainerReqHandler.testCacheFromGlobalLoader SOLR-13650:ref guide typo SOLR-13704: correct error codes for client errors in expand component SOLR-13650: ref guide ...
- Loading branch information
Showing
114 changed files
with
3,896 additions
and
820 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
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
54 changes: 54 additions & 0 deletions
54
lucene/sandbox/src/java/org/apache/lucene/document/DoublePointMultiRangeBuilder.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,54 @@ | ||
/* | ||
* 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.document; | ||
|
||
import org.apache.lucene.search.MultiRangeQuery; | ||
|
||
import static org.apache.lucene.document.DoublePoint.decodeDimension; | ||
import static org.apache.lucene.document.DoublePoint.pack; | ||
|
||
/** Builder for multi range queries for DoublePoints */ | ||
public class DoublePointMultiRangeBuilder extends MultiRangeQuery.Builder { | ||
public DoublePointMultiRangeBuilder(String field, int numDims) { | ||
super(field, Double.BYTES, numDims); | ||
} | ||
|
||
@Override | ||
public MultiRangeQuery build() { | ||
return new MultiRangeQuery(field, numDims, bytesPerDim, clauses) { | ||
@Override | ||
protected String toString(int dimension, byte[] value) { | ||
return Double.toString(decodeDimension(value, 0)); | ||
} | ||
}; | ||
} | ||
|
||
public void add(double[] lowerValue, double[] upperValue) { | ||
if (upperValue.length != numDims || lowerValue.length != numDims) { | ||
throw new IllegalArgumentException("Passed in range does not conform to specified dimensions"); | ||
} | ||
|
||
for (int i = 0; i < numDims; i++) { | ||
if (upperValue[i] < lowerValue[i]) { | ||
throw new IllegalArgumentException("Upper value of range should be greater than lower value of range"); | ||
} | ||
} | ||
add(pack(lowerValue).bytes, pack(upperValue).bytes); | ||
} | ||
} | ||
|
55 changes: 55 additions & 0 deletions
55
lucene/sandbox/src/java/org/apache/lucene/document/FloatPointMultiRangeBuilder.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,55 @@ | ||
/* | ||
* 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.document; | ||
|
||
import org.apache.lucene.search.MultiRangeQuery; | ||
|
||
import static org.apache.lucene.document.FloatPoint.decodeDimension; | ||
import static org.apache.lucene.document.FloatPoint.pack; | ||
|
||
/** | ||
* Builder for multi range queries for FloatPoints | ||
*/ | ||
public class FloatPointMultiRangeBuilder extends MultiRangeQuery.Builder { | ||
public FloatPointMultiRangeBuilder(String field, int numDims) { | ||
super(field, Float.BYTES, numDims); | ||
} | ||
|
||
@Override | ||
public MultiRangeQuery build() { | ||
return new MultiRangeQuery(field, numDims, bytesPerDim, clauses) { | ||
@Override | ||
protected String toString(int dimension, byte[] value) { | ||
return Float.toString(decodeDimension(value, 0)); | ||
} | ||
}; | ||
} | ||
|
||
public void add(float[] lowerValue, float[] upperValue) { | ||
if (upperValue.length != numDims || lowerValue.length != numDims) { | ||
throw new IllegalArgumentException("Passed in range does not conform to specified dimensions"); | ||
} | ||
|
||
for (int i = 0; i < numDims; i++) { | ||
if (upperValue[i] < lowerValue[i]) { | ||
throw new IllegalArgumentException("Upper value of range should be greater than lower value of range"); | ||
} | ||
} | ||
add(pack(lowerValue).bytes, pack(upperValue).bytes); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
lucene/sandbox/src/java/org/apache/lucene/document/IntPointMultiRangeBuilder.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,53 @@ | ||
/* | ||
* 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.document; | ||
|
||
import org.apache.lucene.search.MultiRangeQuery; | ||
|
||
import static org.apache.lucene.document.IntPoint.decodeDimension; | ||
import static org.apache.lucene.document.IntPoint.pack; | ||
|
||
/** Builder for multi range queries for IntPoints */ | ||
public class IntPointMultiRangeBuilder extends MultiRangeQuery.Builder { | ||
public IntPointMultiRangeBuilder(String field, int numDims) { | ||
super(field, Integer.BYTES, numDims); | ||
} | ||
|
||
@Override | ||
public MultiRangeQuery build() { | ||
return new MultiRangeQuery(field, numDims, bytesPerDim, clauses) { | ||
@Override | ||
protected String toString(int dimension, byte[] value) { | ||
return Integer.toString(decodeDimension(value, 0)); | ||
} | ||
}; | ||
} | ||
|
||
public void add(int[] lowerValue, int[] upperValue) { | ||
if (upperValue.length != numDims || lowerValue.length != numDims) { | ||
throw new IllegalArgumentException("Passed in range does not conform to specified dimensions"); | ||
} | ||
|
||
for (int i = 0; i < numDims; i++) { | ||
if (upperValue[i] < lowerValue[i]) { | ||
throw new IllegalArgumentException("Upper value of range should be greater than lower value of range"); | ||
} | ||
} | ||
add(pack(lowerValue).bytes, pack(upperValue).bytes); | ||
} | ||
} |
Oops, something went wrong.