It seems that in order to be available for FieldValueFeature score calculation, the field should be 'stored', otherwise it is not present in the document. It is also seems that indexed/docValue does not matter:
final IndexableField indexableField = document.getField(field); if (indexableField == null) { return getDefaultValue(); } On 2020/04/24 06:39:30, Ashwin Ramesh <ash...@canva.com.INVALID> wrote: > Hi everybody, > > Do we need to have 'indexed=true' to be able to retrieve the value of a > field via FieldValueFeature or is having docValue=true enough? > > Currently, we have some dynamic fields as [dynamicField=true, stored=false, > indexed=false, docValue=true]. However when we noticing that the value > extracted is '0.0'. > > This is the code I read around FieldFeatureValue: > https://github.com/apache/lucene-solr/blob/master/solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/FieldValueFeature.java > > Thanks, > > Ash > > -- > ** > ** <https://www.canva.com/>Empowering the world to design > Share accurate > information on COVID-19 and spread messages of support to your community. > > Here are some resources > <https://about.canva.com/coronavirus-awareness-collection/?utm_medium=pr&utm_source=news&utm_campaign=covid19_templates> > > that can help. > <https://twitter.com/canva> <https://facebook.com/canva> > <https://au.linkedin.com/company/canva> <https://twitter.com/canva> > <https://facebook.com/canva> <https://au.linkedin.com/company/canva> > <https://instagram.com/canva> > > > > > > > > > > >