[
https://issues.apache.org/jira/browse/SOLR-12697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340963#comment-17340963
]
Christine Poerschke commented on SOLR-12697:
--------------------------------------------
{quote}
{code:java}
public class DocValuesFieldValueFeatureScorer extends FieldValueFeatureScorer {
...
} catch (IOException e) {
// this is fine for fields that do not have docValues, we handle
that case with super.score()
floatDocValues = null;
}
...
{code}
{quote}
Thanks [~TomGilke] and Tobi for sharing your approach!
Have you considered for the caller of the constructor to "look ahead" and
construct {{FieldValueFeatureScorer}} or {{DocValuesFieldValueFeatureScorer}}
depending on what is seen? It could provide a way to maintain (for now)
existing behaviour for the {{docValues="true" stored="true"}} case and to avoid
IOException swallowing?
I'm thinking something like this structurally {color:#FF0000}but haven't at all
considered what the DocValuesFieldValueFeatureScorer implementation would look
like ...{color}
{code:java}
public class FieldValueFeatureWeight extends FeatureWeight {
+ private final SchemaField schemaField;
+
public FieldValueFeatureWeight(IndexSearcher searcher,
SolrQueryRequest request, Query originalQuery, Map<String,String[]>
efi) {
super(FieldValueFeature.this, searcher, request, originalQuery, efi);
+ if (searcher instanceof SolrIndexSearcher) {
+ schemaField =
((SolrIndexSearcher)searcher).getSchema().getFieldOrNull(field);
+ } else {
+ schemaField = null;
+ }
}
@Override
public FeatureScorer scorer(LeafReaderContext context) throws IOException {
+ /*
+ if (schemaField != null && !schemaField.stored() &&
schemaField.hasDocValues()) {
+ return new DocValuesFieldValueFeatureScorer(this, context,
+ DocIdSetIterator.all(DocIdSetIterator.NO_MORE_DOCS));
+ }
+ */
return new FieldValueFeatureScorer(this, context,
DocIdSetIterator.all(DocIdSetIterator.NO_MORE_DOCS));
}
{code}
> pure DocValues support for FieldValueFeature
> --------------------------------------------
>
> Key: SOLR-12697
> URL: https://issues.apache.org/jira/browse/SOLR-12697
> Project: Solr
> Issue Type: Sub-task
> Components: contrib - LTR
> Reporter: Stanislav Livotov
> Priority: Major
> Attachments: SOLR-12697.patch, SOLR-12697.patch, SOLR-12697.patch,
> SOLR-12697.patch, SOLR-12697.patch
>
>
> [~slivotov] wrote in SOLR-12688:
> bq. ... FieldValueFeature doesn't support pure DocValues fields (Stored
> false). Please also note that for fields which are both stored and DocValues
> it is working not optimal because it is extracting just one field from the
> stored document. DocValues are obviously faster for such usecases. ...
> (Please see SOLR-12688 description for overall context and analysis results.)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]