apache / apache/lucene

QueryParser with wildcard search does not use Analyzer's tokenizer [LUCENE-7437]

Open
#8,489 4 comments 0 reactions 1 assignee Claimed by @uschindler View on GitHub
affects-version:6.2 legacy-jira-priority:Major module:core/queryparser type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Using a tokenizer that splits at underscores (e.g. SimpleAnalyzer) splits "qwert_asdfghjkl" into two words at the time of indexing.

Searches for "qwert asdf\*" or "qwert_asdfghjkl" work as expected.

However, when a query contains wildcards, e.g. "qwert_asdf\*" the query parser does not use the tokenizer of its analyzer to split the words and thus finds no result.

---
Migrated from [LUCENE-7437](https://issues.apache.org/jira/browse/LUCENE-7437) by Michael Pichler, 1 vote
Attachments: [LuceneTest.java](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-7437/LuceneTest.java)

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.