You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2026/08/19 14:59:48 UTC
(solr) branch main updated: SOLR-18372: remove FunctionQParser.parseMultipleSources accessors (#4753)
This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new b46896f89e6 SOLR-18372: remove FunctionQParser.parseMultipleSources accessors (#4753)
b46896f89e6 is described below
commit b46896f89e6ce779b4e2d782e522cc12cac5668a
Author: Serhiy Bzhezytskyy <me...@serhiy-bzhezytskyy.com>
AuthorDate: Wed Aug 19 17:59:41 2026 +0300
SOLR-18372: remove FunctionQParser.parseMultipleSources accessors (#4753)
---
...18372-remove-parsemultiplesources-accessors.yml | 8 +++++
.../org/apache/solr/search/FunctionQParser.java | 34 +++++++---------------
2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/changelog/unreleased/SOLR-18372-remove-parsemultiplesources-accessors.yml b/changelog/unreleased/SOLR-18372-remove-parsemultiplesources-accessors.yml
new file mode 100644
index 00000000000..f727939cfb1
--- /dev/null
+++ b/changelog/unreleased/SOLR-18372-remove-parsemultiplesources-accessors.yml
@@ -0,0 +1,8 @@
+# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
+title: Remove the deprecated FunctionQParser.setParseMultipleSources and getParseMultipleSources accessors, and the undocumented multiple=true local param that used them. Multi-value parsing itself is unaffected for functions such as geodist and dist, which still work when a $param reference holds a comma separated point.
+type: removed
+authors:
+ - name: Serhiy Bzhezytskyy
+links:
+ - name: SOLR-18372
+ url: https://issues.apache.org/jira/browse/SOLR-18372
diff --git a/solr/core/src/java/org/apache/solr/search/FunctionQParser.java b/solr/core/src/java/org/apache/solr/search/FunctionQParser.java
index 5f5bcf17b7a..46e36ca78f6 100644
--- a/solr/core/src/java/org/apache/solr/search/FunctionQParser.java
+++ b/solr/core/src/java/org/apache/solr/search/FunctionQParser.java
@@ -59,7 +59,6 @@ public class FunctionQParser extends QParser {
*/
public StrParser sp;
- @Deprecated private boolean parseMultipleSources = false;
private boolean parseToEnd = true;
public FunctionQParser(
@@ -67,9 +66,6 @@ public class FunctionQParser extends QParser {
super(qstr, localParams, params, req);
setFlags(FLAG_DEFAULT);
setString(qstr);
- if (localParams != null && localParams.getPrimitiveBool("multiple")) {
- setParseMultipleSources(true);
- }
}
/**
@@ -90,22 +86,6 @@ public class FunctionQParser extends QParser {
}
}
- @Deprecated
- public void setParseMultipleSources(boolean parseMultipleSources) {
- this.parseMultipleSources = parseMultipleSources;
- }
-
- /**
- * Parse multiple comma separated value sources encapsulated into a {@link VectorValueSource} when
- * {@link #getQuery()} or {@link #parseAsValueSource()} is called.
- *
- * @deprecated this is only needed for an unusual use-case and seems hard to support
- */
- @Deprecated
- public boolean getParseMultipleSources() {
- return parseMultipleSources;
- }
-
public void setParseToEnd(boolean parseToEnd) {
this.parseToEnd = parseToEnd;
}
@@ -125,17 +105,21 @@ public class FunctionQParser extends QParser {
* ValueSourceParser#parse(FunctionQParser)}; it's intended for general code that has a {@link
* QParser} but actually wants to parse a ValueSource.
*
- * @return A {@link VectorValueSource} for multiple VS, otherwise just the single VS.
+ * @return the parsed {@link ValueSource}.
*/
@Override
public ValueSource parseAsValueSource() throws SyntaxError {
+ return parseAsValueSource(false);
+ }
+
+ private ValueSource parseAsValueSource(boolean collectMultiple) throws SyntaxError {
ValueSource vs = null;
List<ValueSource> lst = null;
for (; ; ) {
ValueSource valsource = parseValueSource(getFlags() & ~FLAG_CONSUME_DELIMITER);
sp.eatws();
- if (!parseMultipleSources) {
+ if (!collectMultiple) {
vs = valsource;
break;
} else {
@@ -462,10 +446,12 @@ public class FunctionQParser extends QParser {
} else {
QParser subParser = subQuery(val, "func");
if (subParser instanceof FunctionQParser subFunc) {
- subFunc.setParseMultipleSources(true);
subFunc.setFlags(flags);
+ // e.g. geodist($pt) with pt=lat,lon: collect the referenced comma separated values
+ valueSource = subFunc.parseAsValueSource(true);
+ } else {
+ valueSource = subParser.parseAsValueSource();
}
- valueSource = subParser.parseAsValueSource();
}
/*