lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Queixalos (Created) (JIRA)" <>
Subject [jira] [Created] (SOLR-3150) NPE when facetting using facet.prefix on an "empty" field
Date Tue, 21 Feb 2012 17:26:44 GMT
NPE when facetting using facet.prefix on an "empty" field

                 Key: SOLR-3150
             Project: Solr
          Issue Type: Bug
    Affects Versions: 4.0
            Reporter: Pablo Queixalos
             Fix For: 4.0

FacetComponent works fine on empty fields but crashes if facet.prefix parameter is set.

Looking at the code : getOrdTermsEnum(..) returns null if no value is found on the field but
_getCounts(...)_ does not checks if _TermsEnum te_ is null or not.

{code:java| (getCounts(..))}
      TermsEnum te = getOrdTermsEnum(searcher.getAtomicReader());
      if (prefix != null && prefix.length() > 0) {
        final BytesRef prefixBr = new BytesRef(prefix);
232:    if (te.seekCeil(prefixBr, true) == TermsEnum.SeekStatus.END) {
          startTerm = numTermsInField;
        } else {
          startTerm = (int) te.ord();
        if (te.seekCeil(prefixBr, true) == TermsEnum.SeekStatus.END) {
          endTerm = numTermsInField;
        } else {
          endTerm = (int) te.ord();

	at org.apache.solr.request.UnInvertedField.getCounts(
	at org.apache.solr.request.SimpleFacets.getTermCounts(
	at org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
	at org.apache.solr.request.SimpleFacets.getFacetCounts(
	at org.apache.solr.handler.component.FacetComponent.process(

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message