Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4
    • None
    • None

    Description

      Ability to do a range query based on a FieldCache entry or a FunctionQuery (ValueSource).
      Equivalent to Lucene's FieldCacheRangeQuery

      Attachments

        1. SOLR-939.patch
          49 kB
          Yonik Seeley
        2. SOLR-939.patch
          35 kB
          Yonik Seeley
        3. SOLR-939.patch
          31 kB
          Yonik Seeley
        4. SOLR-939.patch
          19 kB
          Yonik Seeley

        Issue Links

          Activity

            yseeley@gmail.com Yonik Seeley added a comment -

            Attaching incomplete draft to help give a feel for the approach.

            Functionallity can be accessed via frange QParser (stands for function range).

            fq=

            {!frange l=5 u=10}popularity

            fq={!frange l=5 u=10}

            product(popularity,2)

            yseeley@gmail.com Yonik Seeley added a comment - Attaching incomplete draft to help give a feel for the approach. Functionallity can be accessed via frange QParser (stands for function range). fq= {!frange l=5 u=10}popularity fq={!frange l=5 u=10} product(popularity,2)

            Yonik, if I understand this correctly (and I don't understand much), the difference between plain FieldCacheRangeFilter and ValueSourceRangeFilter is that VSRF can be used with fields as well as function queries, right?

            To complete this patch, we would need modifications to other field types as well (just as the patch does for IntField). Are there other changes required before this can be committed?

            shalin Shalin Shekhar Mangar added a comment - Yonik, if I understand this correctly (and I don't understand much), the difference between plain FieldCacheRangeFilter and ValueSourceRangeFilter is that VSRF can be used with fields as well as function queries, right? To complete this patch, we would need modifications to other field types as well (just as the patch does for IntField). Are there other changes required before this can be committed?
            yseeley@gmail.com Yonik Seeley added a comment -

            Right - it made sense to me to go through the FunctionQuery/ValueSource abstraction to do range filters, as it's a superset of just going off of the FieldCache (it could work with functions, FileFloatSource, and future payload or column-stored fields too).

            I've been meaning to get back to this patch... at a minimum it would need support for all of the field types as well as tests. I think I may even have some local updates since this last patch - I'll have to check.

            It would be nice if one could tag a field with info to use ValueSourceRangeFilter for any range queries... but it doesn't seem necessary before committing this underlying functionality.

            yseeley@gmail.com Yonik Seeley added a comment - Right - it made sense to me to go through the FunctionQuery/ValueSource abstraction to do range filters, as it's a superset of just going off of the FieldCache (it could work with functions, FileFloatSource, and future payload or column-stored fields too). I've been meaning to get back to this patch... at a minimum it would need support for all of the field types as well as tests. I think I may even have some local updates since this last patch - I'll have to check. It would be nice if one could tag a field with info to use ValueSourceRangeFilter for any range queries... but it doesn't seem necessary before committing this underlying functionality.

            Right - it made sense to me to go through the FunctionQuery/ValueSource abstraction to do range filters, as it's a superset of just going off of the FieldCache (it could work with functions, FileFloatSource, and future payload or column-stored fields too).

            Very cool!

            It would be nice if one could tag a field with info to use ValueSourceRangeFilter for any range queries

            As an extra attribute in the schema? e.g.

            <field name="xyz" type="integer" indexed="true" stored="true" useValueSourceRangeFilter="true" />
            

            +1 for this. It is easier/cleaner than the local param syntax but I guess we'd need to support both anyway. Solrj does not have API methods to manipulate local params and I think this is a good time to add that support.

            I've been meaning to get back to this patch... at a minimum it would need support for all of the field types as well as tests. I think I may even have some local updates since this last patch - I'll have to check.

            Can you post your updates? SOLR-940 (Trie support) is mostly done and I can try to spend some time on this one. Per the 1.4 release discussion, these two are the major features stopping the 1.4 release, though I'm sure we'll find more

            shalin Shalin Shekhar Mangar added a comment - Right - it made sense to me to go through the FunctionQuery/ValueSource abstraction to do range filters, as it's a superset of just going off of the FieldCache (it could work with functions, FileFloatSource, and future payload or column-stored fields too). Very cool! It would be nice if one could tag a field with info to use ValueSourceRangeFilter for any range queries As an extra attribute in the schema? e.g. <field name= "xyz" type= "integer" indexed= "true" stored= "true" useValueSourceRangeFilter= "true" /> +1 for this. It is easier/cleaner than the local param syntax but I guess we'd need to support both anyway. Solrj does not have API methods to manipulate local params and I think this is a good time to add that support. I've been meaning to get back to this patch... at a minimum it would need support for all of the field types as well as tests. I think I may even have some local updates since this last patch - I'll have to check. Can you post your updates? SOLR-940 (Trie support) is mostly done and I can try to spend some time on this one. Per the 1.4 release discussion, these two are the major features stopping the 1.4 release, though I'm sure we'll find more
            yseeley@gmail.com Yonik Seeley added a comment -

            Here's the latest I had... I don't recall exactly what the state of things were, but I had started working on tests (TestRangeQuery) and it built an index will a bunch of different field types, but there wasn't yet code to query.

            yseeley@gmail.com Yonik Seeley added a comment - Here's the latest I had... I don't recall exactly what the state of things were, but I had started working on tests (TestRangeQuery) and it built an index will a bunch of different field types, but there wasn't yet code to query.
            yseeley@gmail.com Yonik Seeley added a comment -

            Attaching patch with some more progress... fixed some bugs and created some query tests (currently failing).

            yseeley@gmail.com Yonik Seeley added a comment - Attaching patch with some more progress... fixed some bugs and created some query tests (currently failing).
            yseeley@gmail.com Yonik Seeley added a comment -

            OK, I think I've fixed all the issues!

            yseeley@gmail.com Yonik Seeley added a comment - OK, I think I've fixed all the issues!
            yseeley@gmail.com Yonik Seeley added a comment -

            Committed.

            yseeley@gmail.com Yonik Seeley added a comment - Committed.
            dsmiley David Smiley added a comment -

            I just happened to be looking at the code for this in StrField.java and I observed that the package-class StrFieldSource isn't being used.

            dsmiley David Smiley added a comment - I just happened to be looking at the code for this in StrField.java and I observed that the package-class StrFieldSource isn't being used.

            Bulk close for Solr 1.4

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

            People

              yseeley@gmail.com Yonik Seeley
              yseeley@gmail.com Yonik Seeley
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: