Christine Poerschke created SOLR-8242:
-----------------------------------------

             Summary: contrib/analytics: relocate hasDocValues() check out of 
FieldFacetAccumulator: 
                 Key: SOLR-8242
                 URL: https://issues.apache.org/jira/browse/SOLR-8242
             Project: Solr
          Issue Type: Task
            Reporter: Christine Poerschke
            Priority: Minor


from SOLR-8147:

Christine Poerschke wrote:
bq. Considering the overall class usage and calling chains, might the 
{{hasDocValues()}} check be relocated to somewhere higher up? From a cursory 
look {{AnalyticsContentHandler.endElement}} and 
{{AnalyticsRequestFactory.(parse|makeFieldFacet|setFieldFacetParam)}} construct 
{{FieldFacetRequest}} objects and perhaps the hasDocValues check could happen 
there i.e. catch the invalid input/bad request when considering request 
parameters and then within the lower level accumulator object the hasDocValues 
check goes away and no SolrException need be thrown by the 
{{FieldFacetAccumulator}}.

Houston Putman wrote:
bq. I agree that the {{hasDocValues()}} check should be moved to 
{{AnalyticsRequestFactory.(makeFieldFacet|setFieldFacetParam)}}. It shouldn't 
add any complexity since those methods are where the {{SchemaField}} 
references, which {{FieldFacetAccumulator}} uses, originate. Other error 
checking could be done in a similar manner. For example {{result()}} calls in 
query and range facets could be validated after 
{{AnalyticsRequestFactory.parse()}} is finished, this would greatly reduce the 
complexity in the {{(BasicAccumulator|FacetingAccumulator).getResult()}} and 
{{FacetingAccumulator.getQueryResult()}} methods. There are probably others, 
but that's the first that popped into my head.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to