Solr
  1. Solr
  2. SOLR-1322

range queries won't work for trie fields with precisionStep=0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4
    • Component/s: search
    • Labels:
      None

      Description

      range queries won't work for trie fields with precisionStep=0... a normal range query should be used in this case.

        Issue Links

          Activity

          Hide
          Yonik Seeley added a comment -

          Oops - precisionStep should be big, not zero... so NumericRangeQuery may still work after all.
          The issue actually has more to do with multiValued fields with a real precisionStep.

          Show
          Yonik Seeley added a comment - Oops - precisionStep should be big, not zero... so NumericRangeQuery may still work after all. The issue actually has more to do with multiValued fields with a real precisionStep.
          Hide
          Shalin Shekhar Mangar added a comment -

          The issue actually has more to do with multiValued fields with a real precisionStep.

          I'm sorry, I don't understand what you mean by that. What is the issue?

          Show
          Shalin Shekhar Mangar added a comment - The issue actually has more to do with multiValued fields with a real precisionStep. I'm sorry, I don't understand what you mean by that. What is the issue?
          Hide
          Yonik Seeley added a comment -

          If trie fields are indexed in parts, NumericRangeQuery will produce invalid results for multiValued fields... that's a limitation of the trie encoding (not easily fixable at all).

          Show
          Yonik Seeley added a comment - If trie fields are indexed in parts, NumericRangeQuery will produce invalid results for multiValued fields... that's a limitation of the trie encoding (not easily fixable at all).
          Hide
          Yonik Seeley added a comment -

          committed - precisionStep is ignored if the field is multiValued.

          Show
          Yonik Seeley added a comment - committed - precisionStep is ignored if the field is multiValued.
          Hide
          Uwe Schindler added a comment -

          If trie fields are indexed in parts, NumericRangeQuery will produce invalid results for multiValued fields... that's a limitation of the trie encoding (not easily fixable at all).

          I do not really understand the problem with MultiValueFields. I had trie fields in my index in the past that had multiple trie values and numeric range queries worked with it. What is the problem? You should be able to add more than one value using separate Field instances to the index.

          A NumericRangeQuery on a MultiValued field should show results for all documents as soon as one of the indexed values fall into the range. Correct me if I am wrong!

          Show
          Uwe Schindler added a comment - If trie fields are indexed in parts, NumericRangeQuery will produce invalid results for multiValued fields... that's a limitation of the trie encoding (not easily fixable at all). I do not really understand the problem with MultiValueFields. I had trie fields in my index in the past that had multiple trie values and numeric range queries worked with it. What is the problem? You should be able to add more than one value using separate Field instances to the index. A NumericRangeQuery on a MultiValued field should show results for all documents as soon as one of the indexed values fall into the range. Correct me if I am wrong!
          Hide
          Yonik Seeley added a comment -

          A NumericRangeQuery on a MultiValued field should show results for all documents as soon as one of the indexed values fall into the range.

          Ah, you're right, because NumericRangeQuery uses a pure disjunctive model (it only logically ORs different terms).
          Any types of queries that did an AND inbetween terms would get messed up, but we don't have any of those!

          Show
          Yonik Seeley added a comment - A NumericRangeQuery on a MultiValued field should show results for all documents as soon as one of the indexed values fall into the range. Ah, you're right, because NumericRangeQuery uses a pure disjunctive model (it only logically ORs different terms). Any types of queries that did an AND inbetween terms would get messed up, but we don't have any of those!
          Hide
          Yonik Seeley added a comment -

          reopening - tries can work for multiValued fields

          Show
          Yonik Seeley added a comment - reopening - tries can work for multiValued fields
          Hide
          Uwe Schindler added a comment -

          Correct, but it is good to think about it multiple times. I always fall into the same trap when thinking about it, but as soon as I have a picture with the indexed terms it gets clear again. I think, I should write a test about this special case inside TestNumericRangeQueryXX (index multiple values and do some ranges with precStep=inf and real precStep on the same field and compare results).

          Show
          Uwe Schindler added a comment - Correct, but it is good to think about it multiple times. I always fall into the same trap when thinking about it, but as soon as I have a picture with the indexed terms it gets clear again. I think, I should write a test about this special case inside TestNumericRangeQueryXX (index multiple values and do some ranges with precStep=inf and real precStep on the same field and compare results).
          Hide
          Uwe Schindler added a comment -

          I added a test to Lucene Core that verifies, that multi-valued terms work correctly: Revision #800896

          Show
          Uwe Schindler added a comment - I added a test to Lucene Core that verifies, that multi-valued terms work correctly: Revision #800896
          Hide
          Yonik Seeley added a comment -

          committed patch that removes precisionStep checks if multiValued and updates comments in the example schema.

          Show
          Yonik Seeley added a comment - committed patch that removes precisionStep checks if multiValued and updates comments in the example schema.
          Hide
          Grant Ingersoll added a comment -

          Bulk close for Solr 1.4

          Show
          Grant Ingersoll added a comment - Bulk close for Solr 1.4

            People

            • Assignee:
              Yonik Seeley
              Reporter:
              Yonik Seeley
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development