Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7044

Range faceting fails on SortedNumericDocValuesField

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Hi,

      Context: https://hibernate.atlassian.net/browse/HSEARCH-1927

      By using SortedNumericDocValuesField, we can index several numeric values for the same field.

      But we can't execute a range query on it using LongRangeFacetCounts.

      Lucene fails with the following stacktrace:

      java.lang.IllegalStateException: unexpected docvalues type SORTED_NUMERIC for field 'ingredients.price' (expected=NUMERIC). Use UninvertingReader or index with docvalues.
      	at org.apache.lucene.index.DocValues.checkField(DocValues.java:208)
      	at org.apache.lucene.index.DocValues.getNumeric(DocValues.java:227)
      	at org.apache.lucene.queries.function.valuesource.LongFieldSource.getValues(LongFieldSource.java:67)
      	at org.apache.lucene.facet.range.LongRangeFacetCounts.count(LongRangeFacetCounts.java:80)
      	at org.apache.lucene.facet.range.LongRangeFacetCounts.<init>(LongRangeFacetCounts.java:69)
      

      Either LongRangeFacetCounts needs some tweaking to accept SORTED_NUMERIC or we need another implementation to deal with SortedNumericDocValuesField (and probably an implementation of both for Doubles).


      Guillaume

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            gsmet Guillaume Smet
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development