[
https://issues.apache.org/jira/browse/LUCENE-5470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13912891#comment-13912891
]
Tim Allison commented on LUCENE-5470:
-------------------------------------
On second thought...please disregard above. We shouldn't be encouraging misuse
of analyzers via hacks for wildcard analysis now that the problem has been
fixed at the Solr level.
I feel fairly strongly that analyzeMultitermTerm should be fairly high up the
stack...not quite at Object, perhaps. :)
The case for putting analyzeMultitermTerm as a static helper function (?) in
QueryBuilder or at least something higher up than QueryParserBase is mostly
aesthetic IMHO. It feels awkward to me to create SolrQueryParserBase as a
sister to QueryParserBase and then have it effectively calling its sister's
static function (if we put analyzeMultitermTerm in QueryParserBase). It feels
slightly less awkward to have it calling its parent's helper function. By
"effectively," of course, I don't mean that SQPB is actually calling it itself,
but it does effectively do it through TextField.
So, my proposal for this patch is to leave analyzeMultitermTerm in QueryBuilder
and put analyzeWildcard back into AnalyzingQueryParser where it belongs.
I'm happy to defer to the community, though. I've come late to the party and
this has probably been thoroughly discussed.
> Refactoring multiterm analysis
> ------------------------------
>
> Key: LUCENE-5470
> URL: https://issues.apache.org/jira/browse/LUCENE-5470
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/queryparser
> Affects Versions: 5.0
> Reporter: Tim Allison
> Priority: Minor
> Attachments: LUCENE-5470.patch
>
>
> There are currently three methods to analyze multiterms in Lucene and Solr:
> 1) QueryParserBase
> 2) AnalyzingQueryParser
> 3) TextField (Solr)
> The code in QueryParserBase and in TextField do not consume the tokenstream
> if more than one token is generated by the analyzer. (Admittedly, thanks to
> the magic of MultitermAwareComponents in Solr, this type of exception
> probably never happens and the unconsumed stream problem is probably
> non-existent in Solr.)
> I propose consolidating the multiterm analysis code into one place:
> QueryBuilder in Lucene core.
> This is part of a refactoring that will also help reduce duplication of code
> with LUCENE-5205.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]