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

TermAutomatonQuery should rewrite to a simpler query when possible

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4, 7.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Spinoff from LUCENE-6664.

      I think TermAutomatonQuery would be easier to integrate into query parsers if you could simply use it always and it would rewrite to simpler / faster queries when possible.

      This way, when a query parser is confronted with a phrase query requested by the user, it can just make a TermAutomatonQuery and run that.

      But the non-explicit phrase query case is still tricky...

      1. LUCENE-6824.patch
        13 kB
        Michael McCandless
      2. LUCENE-6824.patch
        12 kB
        Michael McCandless

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Patch.

        I tackle the MatchNoDocsQuery, TermQuery, PhraseQuery and MultiPhraseQuery cases.

        I think it would also be possible to e.g. sometimes rewrite to union of PhraseQuery but I'm not sure what cases we should do that for.

        Show
        mikemccand Michael McCandless added a comment - Patch. I tackle the MatchNoDocsQuery , TermQuery , PhraseQuery and MultiPhraseQuery cases. I think it would also be possible to e.g. sometimes rewrite to union of PhraseQuery but I'm not sure what cases we should do that for.
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk move of still open issues from 6.2 to 6.3.

        Show
        mikemccand Michael McCandless added a comment - Bulk move of still open issues from 6.2 to 6.3.
        Hide
        mikemccand Michael McCandless added a comment -

        New patch, just that last patch modernized to apply to master today. I'll push soon.

        Show
        mikemccand Michael McCandless added a comment - New patch, just that last patch modernized to apply to master today. I'll push soon.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cc99815dcbaa796d717601d600645e658eb9f882 in lucene-solr's branch refs/heads/master from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cc99815 ]

        LUCENE-6824: TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple

        Show
        jira-bot ASF subversion and git services added a comment - Commit cc99815dcbaa796d717601d600645e658eb9f882 in lucene-solr's branch refs/heads/master from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cc99815 ] LUCENE-6824 : TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c294d3f08317eb9139f32bfbde1b27e7eb134653 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c294d3f ]

        LUCENE-6824: TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple

        Show
        jira-bot ASF subversion and git services added a comment - Commit c294d3f08317eb9139f32bfbde1b27e7eb134653 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c294d3f ] LUCENE-6824 : TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cc99815dcbaa796d717601d600645e658eb9f882 in lucene-solr's branch refs/heads/apiv2 from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cc99815 ]

        LUCENE-6824: TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple

        Show
        jira-bot ASF subversion and git services added a comment - Commit cc99815dcbaa796d717601d600645e658eb9f882 in lucene-solr's branch refs/heads/apiv2 from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cc99815 ] LUCENE-6824 : TermAutomatonQuery now rewrites to TermQuery, PhraseQuery or MultiPhraseQuery when the word automaton is simple

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            mikemccand Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development