Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.util.DateMathParser;
import org.apache.solr.util.SolrPluginUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -242,6 +244,14 @@ public AqpAdsabsQParser(AqpQueryParser parser, String qstr, SolrParams localPara
}
}

req.getSchema().getFields().forEach((fieldName, schemaField) -> {
switch (schemaField.getType().getNumberType()) {
case FLOAT, DOUBLE -> ncm.put(fieldName, new PointsConfig(new MaxNumberFormat(Float.MAX_VALUE), Float.class));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem safe to map DOUBLE into Float - is there a good reason not to make another case statement? for DOUBLE?

case INTEGER, LONG -> ncm.put(fieldName, new PointsConfig(new MaxNumberFormat(Integer.MAX_VALUE), Integer.class));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment, but for LONG - why not have another case statement to handle LONG?

case null, default -> {}
}
});

config.get(AqpAdsabsQueryConfigHandler.ConfigurationKeys.VIRTUAL_FIELDS).putAll(defaultConfig.virtualFields);

if (params.get("aqp.allow.leading_wildcard", null) != null) {
Expand Down
Loading