You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by iv...@apache.org on 2022/09/27 08:53:30 UTC
[lucene] branch branch_9x updated: Build SpatialVisitor once per index (#11825)
This is an automated email from the ASF dual-hosted git repository.
ivera pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 937fa370bb2 Build SpatialVisitor once per index (#11825)
937fa370bb2 is described below
commit 937fa370bb2600c68c85a7392d2fb572ba31d60d
Author: Ignacio Vera <iv...@apache.org>
AuthorDate: Tue Sep 27 10:51:49 2022 +0200
Build SpatialVisitor once per index (#11825)
Address a performance regression on polygon queries using LatLonPoint field.
---
lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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 f429f1cc046..612c1e0c16d 100644
--- a/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/document/SpatialQuery.java
@@ -208,6 +208,7 @@ abstract class SpatialQuery extends Query {
@Override
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) {
final SpatialQuery query = this;
+ final SpatialVisitor spatialVisitor = getSpatialVisitor();
return new ConstantScoreWeight(query, boost) {
@Override
public Scorer scorer(LeafReaderContext context) throws IOException {
@@ -221,7 +222,7 @@ abstract class SpatialQuery extends Query {
@Override
public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {
final LeafReader reader = context.reader();
- return getScorerSupplier(reader, getSpatialVisitor(), scoreMode, this, boost, score());
+ return getScorerSupplier(reader, spatialVisitor, scoreMode, this, boost, score());
}
@Override