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

Add getters for the properties of several Query implementations

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0, 6.1, 7.0
    • Component/s: core/query/scoring
    • Labels:
    • Lucene Fields:
      New, Patch Available
    • Flags:
      Patch

      Description

      Hi!

      At Hibernate Search, we are currently working on an Elasticsearch backend (aside from the existing Lucene backend).

      As part of this effort, to provide a smooth migration path, we need to be able to rewrite the Lucene queries as Elasticsearch queries. We know it will be neither perfect or comprehensive but we want it to be the best possible experience.

      It works well in many cases but several implementations of Query don't have the necessary getters to be able to extract the information from the Query.

      The attached patch add getters to several implementations of Query. It would be nice if it could be applied.

      Any chance it could be applied to the next point release too? (probably not but I'd better ask).

        Activity

        Hide
        romseygeek Alan Woodward added a comment -

        I think this is a good idea - my luwak query analyzers could use a lot of these as well, rather than relying on reflection.

        The branch for the 6.0.0 release has been cut, but I think we could probably sneak this in as it's a pretty safe change. Nicholas Knize you're the release manager, what do you think?

        Show
        romseygeek Alan Woodward added a comment - I think this is a good idea - my luwak query analyzers could use a lot of these as well, rather than relying on reflection. The branch for the 6.0.0 release has been cut, but I think we could probably sneak this in as it's a pretty safe change. Nicholas Knize you're the release manager, what do you think?
        Hide
        gsmet Guillaume Smet added a comment -

        Hi Alan,

        Yeah, it's not the most clever patch you'll ever see but I think it's useful and without risk!

        Show
        gsmet Guillaume Smet added a comment - Hi Alan, Yeah, it's not the most clever patch you'll ever see but I think it's useful and without risk!
        Hide
        nknize Nicholas Knize added a comment -

        Thanks Guillaume Smet. Patch LGTM. It's low risk so I'm ok with this going into 6x.

        Show
        nknize Nicholas Knize added a comment - Thanks Guillaume Smet . Patch LGTM. It's low risk so I'm ok with this going into 6x.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 682b179605bace3f2ebec8b55517463906cc249d in lucene-solr's branch refs/heads/master from Alan Woodward
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=682b179 ]

        LUCENE-7058: Add getters for various Query implementations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 682b179605bace3f2ebec8b55517463906cc249d in lucene-solr's branch refs/heads/master from Alan Woodward [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=682b179 ] LUCENE-7058 : Add getters for various Query implementations
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 8e18b1ea57daf040daee709d45cd4f10f28389b8 in lucene-solr's branch refs/heads/branch_6x from Alan Woodward
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8e18b1e ]

        LUCENE-7058: Add getters for various Query implementations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 8e18b1ea57daf040daee709d45cd4f10f28389b8 in lucene-solr's branch refs/heads/branch_6x from Alan Woodward [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8e18b1e ] LUCENE-7058 : Add getters for various Query implementations
        Hide
        thetaphi Uwe Schindler added a comment -

        Thanks! I was about to open an issue for FieldValueQuery. After porting some code to Lucene 5.5, this was only solveable with a MethodHandle pointing to the private field FieldValueFilter had getField() but not the new one.

        Show
        thetaphi Uwe Schindler added a comment - Thanks! I was about to open an issue for FieldValueQuery. After porting some code to Lucene 5.5, this was only solveable with a MethodHandle pointing to the private field FieldValueFilter had getField() but not the new one.
        Hide
        gsmet Guillaume Smet added a comment -

        Yes, would be a good rule of thumb to always expose the properties through getters for the new Query implementations. Don't know if you have documentation somewhere for this.

        Show
        gsmet Guillaume Smet added a comment - Yes, would be a good rule of thumb to always expose the properties through getters for the new Query implementations. Don't know if you have documentation somewhere for this.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 437dd7a18afaac0b9caaf11fd9058e3b199d3ba1 in lucene-solr's branch refs/heads/branch_6_0 from Alan Woodward
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=437dd7a ]

        LUCENE-7058: Add getters for various Query implementations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 437dd7a18afaac0b9caaf11fd9058e3b199d3ba1 in lucene-solr's branch refs/heads/branch_6_0 from Alan Woodward [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=437dd7a ] LUCENE-7058 : Add getters for various Query implementations
        Hide
        romseygeek Alan Woodward added a comment -

        Thanks Guillaume!

        Show
        romseygeek Alan Woodward added a comment - Thanks Guillaume!
        Hide
        sanne Sanne Grinovero added a comment -

        Great, that's very handy! Thanks all for the speedy reviews and merge.

        Show
        sanne Sanne Grinovero added a comment - Great, that's very handy! Thanks all for the speedy reviews and merge.
        Hide
        hossman Hoss Man added a comment -

        Manually correcting fixVersion per Step #S6 of LUCENE-7271

        Show
        hossman Hoss Man added a comment - Manually correcting fixVersion per Step #S6 of LUCENE-7271

          People

          • Assignee:
            romseygeek Alan Woodward
            Reporter:
            gsmet Guillaume Smet
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development