[jira] [Created] (LUCENE-6703) IllegalArgumentException in QueryParserBase.parse()
Oliver Becker created LUCENE-6703: - Summary: IllegalArgumentException in QueryParserBase.parse() Key: LUCENE-6703 URL: https://issues.apache.org/jira/browse/LUCENE-6703 Project: Lucene - Core Issue Type: Bug Components: core/queryparser Affects Versions: 4.10.4 Reporter: Oliver Becker I have encountered a very special case where parsing a certain String with the {{MultiFieldQueryParser}} causes an {{IllegalArgumentException}} thrown in the constructor of {{org.apache.lucene.util.automaton.RegExp}}. I would have expected a {{ParseException}} instead (as stated in the API doc). {code} QueryParser parser = new MultiFieldQueryParser(...); parser.parse("/x)/"); {code} The "evil" search string is *{{/x)/}}*. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6667) Custom attributes get cleared by SynonymFilter
[ https://issues.apache.org/jira/browse/LUCENE-6667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618517#comment-14618517 ] Oliver Becker commented on LUCENE-6667: --- Ah, ok, now I understand. Yes, this happens for tokens that will be replaced by the synonym filter, i.e. for inserted tokens (and it is a single token replacement). But I see the problem. > Custom attributes get cleared by SynonymFilter > -- > > Key: LUCENE-6667 > URL: https://issues.apache.org/jira/browse/LUCENE-6667 > Project: Lucene - Core > Issue Type: Bug >Affects Versions: 4.10.4 >Reporter: Oliver Becker > > I believe the Lucene API enables users to define their custom attributes (by > extending {{AttributeImpl}}) which may be added by custom Tokenizers. > It seems, the {{clear}} and {{copyTo}} methods must be implemented to clear > and restore the state of this custom attribute. > However, some filters (in our case the SynonymFilter) simply call > {{AttributeSource.clearAttributes}} without invoking {{copyTo}}. Instead the > filter just resets some known attributes, simply ignoring all other custom > attributes. In the end our custom attribute value is lost. > Is this a bug in {{SynonymFilter}} (and others) or are we using the API in > the wrong way? > A solution might be of course to provide empty implementations of {{clear}} > and {{copyTo}}, but I'm not sure if this has other unwanted effects. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Created] (LUCENE-6667) Custom attributes get cleared by filters
Oliver Becker created LUCENE-6667: - Summary: Custom attributes get cleared by filters Key: LUCENE-6667 URL: https://issues.apache.org/jira/browse/LUCENE-6667 Project: Lucene - Core Issue Type: Bug Affects Versions: 4.10.4 Reporter: Oliver Becker I believe the Lucene API enables users to define their custom attributes (by extending {{AttributeImpl}}) which may be added by custom Tokenizers. It seems, the {{clear}} and {{copyTo}} methods must be implemented to clear and restore the state of this custom attribute. However, some filters (in our case the SynonymFilter) simply call {{AttributeSource.clearAttributes}} without invoking {{copyTo}}. Instead the filter just resets some known attributes, simply ignoring all other custom attributes. In the end our custom attribute value is lost. Is this a bug in {{SynonymFilter}} (and others) or are we using the API in the wrong way? A solution might be of course to provide empty implementations of {{clear}} and {{copyTo}}, but I'm not sure if this has other unwanted effects. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org