apache / apache/lucene

Move analysis of multiterms into QueryParserBase [LUCENE-5504]

Open
#6,567 0 comments 0 reactions 0 assignees View on GitHub
affects-version:6.0 legacy-jira-priority:Minor module:core/queryparser type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Thanks to MultitermAwareComponents, multiterm analysis works elegantly in Solr. In Lucene, we have:

QueryParserBase and most descendants:
1) can lowercase multiterms
2) can analyze rangeterms
3) can't analyze: fuzzy, prefix, regex, wildcards

AnalyzingQueryParser
1) allows use of main analyzer (with some regex hackery around wildcards...mea culpa) to analyze fuzzy, prefix, wildcards
2) does not handle regex terms

It would be cleaner if we got rid of the lowercasing and special analysis of range terms and substituted an init() with two analyzers: a regular analyzer and a multiterm analyzer. We'll want to improve javadocs and perhaps add a SimpleKeyWordLowerCasingAnalyzer...to make the transition easier.

If we make this change, we'd clean up the hodgepodge of multiterm analysis options (get rid of AnalyzingQueryParser) and add multiterm analysis to everything that extends QueryParserBase.

This is part of the effort to deduplicate code with the integration of #6269.

---
Migrated from [LUCENE-5504](https://issues.apache.org/jira/browse/LUCENE-5504) by Tim Allison (@tballison), updated May 09 2016
Attachments: [LUCENE-5504_draft.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5504/LUCENE-5504_draft.patch)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.