apache / apache/lucene

stop word/punctuation QueryParser error(return all records) [LUCENE-7200]

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

Description

when user input some stop words or punctuation.
It return all records??

```Java
`@Test`
public void test01() throws ParseException {
QueryParser parser = new QueryParser("test", new CJKAnalyzer());
Query parse = parser.parse("test:hello AND (a)");
//Query parse = parser.parse("test:hello AND (;)");
System.out.println(parse.toString());
}
```

Does "test:hello AND (a)" === "test:hello"

thanks?

---
Migrated from [LUCENE-7200](https://issues.apache.org/jira/browse/LUCENE-7200) by Littlestar, updated Apr 12 2016

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided QueryParser example with CJKAnalyzer, testing both the stop-word and punctuation inputs. Read the QueryParser parsing path and existing parser tests to determine the intended treatment of empty clauses. Done means the expected behavior is documented by a regression test and the parser no longer returns an unintended broad query.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.