Skip to content

Apache Lucene open-source search software

SOLR-8902: fix glob test (put back the fields.clear())

Ryan McKinley6b7030d637e8
diff --git a/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java b/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
index b667f0e2e46..34ef79e674f 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
@@ -130,6 +130,13 @@ public class SolrReturnFields extends ReturnFields {
}
augmenters.addTransformer( new RenameFieldTransformer( from, to, copy ) );
}
+ if( !_wantsAllFields && !globs.isEmpty() ) {
+ // TODO??? need to fill up the fields with matching field names in the index
+ // and add them to okFieldNames?
+ // maybe just get all fields?
+ // this would disable field selection optimization... i think thatis OK
+ fields.clear(); // this will get all fields, and use wantsField to limit
+ }
if( augmenters.size() == 1 ) {
transformer = augmenters.getTransformer(0);