lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krishna Keldec (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-5344) StandardQueryParser ignores Default Operators
Date Thu, 21 Nov 2013 13:43:55 GMT

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

Krishna Keldec updated LUCENE-5344:
-----------------------------------

    Fix Version/s: 4.6

> StandardQueryParser ignores Default Operators
> ---------------------------------------------
>
>                 Key: LUCENE-5344
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5344
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/queryparser
>    Affects Versions: 4.5
>            Reporter: Krishna Keldec
>             Fix For: 4.6
>
>
> AnalyzerQueryNodeProcessor ignores default operator when creating boolean query clauses
for overloaded tokens.
> Classic query parser output: {{+content:a +content:320}}
> {code:java}
> QueryParser classicQueryParser;
> classicQueryParser = new QueryParser(Version.LUCENE_45, "content", anaylzer);
> classicQueryParser.setDefaultOperator(Operator.AND);
> classicQueryParser.parse("a320"));
> {code}
> Flexible query parser output: {{content:a content:320}} *(ignores default operator)*
> {code:java}
> StandardQueryParser flexibleQueryParser;
> flexibleQueryParser = new StandardQueryParser(anaylzer);
> flexibleQueryParser.setDefaultOperator(Operator.AND);
> flexibleQueryParser.parse("a320", "content"));
> {code}
> The used analyzer:
> {code:java}
> Analyzer anaylzer = return new Analyzer() {
>   protected TokenStreamComponents createComponents(String field, Reader in) {
>   Tokenizer   src = new WhitespaceTokenizer(Version.LUCENE_45, in);
>   TokenStream tok = new WordDelimiterFilter(src,
>      WordDelimiterFilter.SPLIT_ON_NUMERICS |
>      WordDelimiterFilter.GENERATE_WORD_PARTS |
>      WordDelimiterFilter.GENERATE_NUMBER_PARTS,
>      CharArraySet.EMPTY_SET); 
>   return new TokenStreamComponents(src, tok);
> };
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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


Mime
View raw message