[
https://issues.apache.org/jira/browse/SOLR-12979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16680571#comment-16680571
]
Hoss Man commented on SOLR-12979:
---------------------------------
For Example: Note that techproducts has this field definied...
{noformat}
<field name="_src_" type="string" indexed="false" stored="true"/>
{noformat}
Here is how collapsing on that field behaves when there are no docs in the
index with that field, depending on the value of {{hint}}...
{noformat}
$ bin/solr -e techproducts
...
# regular collapse
$ curl
'http://localhost:8983/solr/techproducts/select?q=*:*&omitHeader=true&rows=100&&fq=%7B!collapse%20field=_src_%7D'
{
"response":{"numFound":0,"start":0,"docs":[]
}}
# hint=top_fc
$ curl
'http://localhost:8983/solr/techproducts/select?q=*:*&omitHeader=true&rows=100&&fq=%7B!collapse%20hint=top_fc%20field=_src_%7D'
{
"error":{
"msg":"java.lang.NullPointerException",
"trace":"java.lang.RuntimeException: java.lang.NullPointerException\n\tat
org.apache.solr.search.CollapsingQParserPlugin$CollapsingPostFilter.getFilterCollector(CollapsingQParserPlugin.java:384)\n\tat
org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(...
{noformat}
And here is how the behavior changes once at least one document is added...
{noformat}
$ curl -H 'Content-Type: application/json'
'http://localhost:8983/solr/techproducts/update?commit=true' --data-binary
'[{"id":"hoss","_src_":"foo"}]'
...
# regular collapse
$ curl
'http://localhost:8983/solr/techproducts/select?q=*:*&omitHeader=true&rows=100&&fq=%7B!collapse%20field=_src_%7D'
{
"error":{
"msg":"unexpected docvalues type NONE for field '_src_' (expected=SORTED).
Re-index with correct docvalues type.",
"trace":"java.lang.IllegalStateException: unexpected docvalues type NONE
for field '_src_' (expected=SORTED). Re-index with corre...
# hint=top_fc
$ curl
'http://localhost:8983/solr/techproducts/select?q=*:*&omitHeader=true&rows=100&&fq=%7B!collapse%20hint=top_fc%20field=_src_%7D'
{
"error":{
"msg":"java.lang.NullPointerException",
"trace":"java.lang.RuntimeException: java.lang.NullPointerException\n\tat
org.apache.solr.search.CollapsingQParserPlugin$CollapsingPostFilter.getFilterCollector(CollapsingQParserPlugin.java:384)\n\tat
org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(...
{noformat}
> CollapseQParser: inconsistent error handling when a field is indexed=false
> docValues=false
> ------------------------------------------------------------------------------------------
>
> Key: SOLR-12979
> URL: https://issues.apache.org/jira/browse/SOLR-12979
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Hoss Man
> Priority: Major
>
> The CollapseQParser behaves oddly and gives inconsistent error messages if
> you try to use it on a field that is {{indexed="false docValues="false"}} --
> paerticularly when {{hint=top_fc}} is also used and a NullPointerException
> gets thrown.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]