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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16377874#comment-16377874 ] 

Adrien Grand commented on LUCENE-8159:
--------------------------------------

Having a copy constructor to modify the field feels a bit weird to me. I's rather like to expose an expert constructor that takes a compiled automaton and expect users to compile the automaton themselves if they plan to reuse it in multiple queries?

bq. Should PrefixQuery & WildcardQuery & TermRangeQuery have the same constructors too?

I'm open to discussing such a change on AutomatonQuery which I consider an expert query. However I would like to keep PrefixQuery/WildcardQuery as simple as possible so I think we shouldn't add a new constructor there. Those queries generate very simple automata so I wouldn't expect this optimization to help significantly.

> 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