You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2018/02/26 22:26:00 UTC

[jira] [Assigned] (LUCENE-8159) Add a copy constructor in AutomatonQuery to copy directly the compiled automaton

     [ https://issues.apache.org/jira/browse/LUCENE-8159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley reassigned LUCENE-8159:
------------------------------------

    Assignee: David Smiley

This looks good to me.  I'd only trivially change the parameter order so that the field name is first, which I think aligns better with the Query subclass constructors.

Should PrefixQuery & WildcardQuery & TermRangeQuery have the same constructors too?  Probably... otherwise if you are rewriting one of these you could only convert it to a generic AutomatonQuery instead of the specific type.  That's not a big deal perhaps but still.

As an aside, this reminds me of some ideas I've had about a different Query API that Lucene could have in which the field is inherited from the parent instead of being attached to each leaf Query, sorta like how boosts were refactored out of Query.  So you'd have a FieldQuery(...) that wraps a possibly complex query with a TermQuery inside that only has the term bytes, no field reference. And then Query.createWeight would reference the field just as it does the score.  Any way, such a hypothetical won't be happening on this issue!

> Add a copy constructor in AutomatonQuery to copy directly the compiled automaton
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-8159
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8159
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: trunk
>            Reporter: Bruno Roustant
>            Assignee: David Smiley
>            Priority: Major
>         Attachments: 0001-Add-a-copy-constructor-in-AutomatonQuery-to-copy-dir.patch, LUCENE-8159.patch
>
>
> When the query is composed of multiple AutomatonQuery with the same automaton and which target different fields, it is much more efficient to reuse the already compiled automaton by copying it directly and just changing the target field.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org