[ 
https://issues.apache.org/jira/browse/SOLR-2976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-2976:
---------------------------

    Attachment: SOLR-2976.patch
                SOLR-2976_3.4_test.patch

SOLR-2976_3.4_test.patch is a simple test patch against 3.4 showing the basics 
of what use to work when trying to do stats faceting on trie fields.  If you 
apply this patch to 3.5 or the 3x branch (requires massaging as the line 
numbers have changed heavily) you'll see the test fail.

SOLR-2976.patch shows my attempt at fixing some of these problems on trunk...

1) fix TrieField.isTokenized to be based on precision step
2) test TrieField.isTokenized
3) fix StatsComponent to look at the SchemaField not just the FieldType
4) make StatsComponentTest give better errors
5) make StatsComponentTest try to use stats.facet on a trie field with one term 
per value

But doing this has exposed a new bug i don't fully understand yet: Test now 
throws an NFE that seems to be coming from the code for generating the stat's 
facets on a trie field -- but it is dependent on which field type we are 
generating stats over.  If the stats are against a trie field, then the 
faceting on a trie field fails -- but if the stats are on a simple numeric, 
then the faceting on a trie field passes.  

Need to wade into this more later...

{code}
    [junit] Testcase: 
testStats(org.apache.solr.handler.component.StatsComponentTest):  Caused an 
ERROR
    [junit] exception with field: stats_ti
    [junit] java.lang.RuntimeException: exception with field: stats_ti
    [junit]     at 
org.apache.solr.handler.component.StatsComponentTest.testStats(StatsComponentTest.java:68)
    [junit]     at 
org.apache.lucene.util.LuceneTestCase$3$1.evaluate(LuceneTestCase.java:528)
    [junit]     at 
org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:165)
    [junit]     at 
org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:57)
    [junit] Caused by: java.lang.RuntimeException: Exception during query
    [junit]     at 
org.apache.solr.util.AbstractSolrTestCase.assertQ(AbstractSolrTestCase.java:267)
    [junit]     at 
org.apache.solr.handler.component.StatsComponentTest.doTestFacetStatisticsResult(StatsComponentTest.java:275)
    [junit]     at 
org.apache.solr.handler.component.StatsComponentTest.testStats(StatsComponentTest.java:65)
    [junit] Caused by: java.lang.NumberFormatException: For input string: "N"
    [junit]     at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    [junit]     at java.lang.Integer.parseInt(Integer.java:449)
    [junit]     at java.lang.Integer.parseInt(Integer.java:499)
    [junit]     at 
org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:303)
    [junit]     at 
org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:294)
    [junit]     at 
org.apache.solr.schema.TrieField.toInternal(TrieField.java:324)
    [junit]     at 
org.apache.solr.request.UnInvertedField.getStats(UnInvertedField.java:609)
    [junit]     at 
org.apache.solr.handler.component.SimpleStats.getStatsFields(StatsComponent.java:235)
    [junit]     at 
org.apache.solr.handler.component.SimpleStats.getStatsCounts(StatsComponent.java:211)
    [junit]     at 
org.apache.solr.handler.component.StatsComponent.process(StatsComponent.java:70)

{code}

                
> stats.facet no longer works on single valued trie fields that don't use 
> precision step
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-2976
>                 URL: https://issues.apache.org/jira/browse/SOLR-2976
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 3.5
>            Reporter: Hoss Man
>         Attachments: SOLR-2976.patch, SOLR-2976_3.4_test.patch
>
>
> As reported on the mailing list, 3.5 introduced a regression that prevents 
> single valued Trie fields that don't use precision steps (to add course 
> grained terms) from being used in stats.facet.
> two immediately obvious problems...
> 1) in 3.5 the stats component is checking if isTokenzed() is true for the 
> field type (which is probably wise) but regardless of the precisionStep used, 
> TrieField.isTokenized is hardcoded to return true
> 2) the 3.5 stats faceting will fail if the FieldType is multivalued - it 
> doesn't check if the SchemaField is configured to be single valued 
> (overriding the FieldType)
> so even if a user has something like this in their schema...
> {code}
> <fieldType name="long" class="solr.TrieLongField" precisionStep="0" 
> omitNorms="true" />
> <field name="ts" type="long" indexed="true" stored="true" required="true" 
> multiValued="false" />
> {code}
> ...stats.facet will not work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to