apache / apache/lucene

DirectSpellChecker needs better parameter checks [LUCENE-8147]

Open
#9,195 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:suggest type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

This thing has a lot of parameters (and option setters too), but looks like it really needs better checks. For example if i ask for zero suggestions I think it may give a confusing NPE instead: [SOLR-11858](https://issues.apache.org/jira/browse/SOLR-11858)

There are probably other cases too: we should add all the missing checks and give IllegalArgumentExceptions and so on instead.

---
Migrated from [LUCENE-8147](https://issues.apache.org/jira/browse/LUCENE-8147) by Robert Muir (@rmuir)
Linked issues:
- [SOLR-11858](https://issues.apache.org/jira/browse/SOLR-11858)

Contributor guide

Open the contributing guide

Research direction

Start with the DirectSpellChecker entry point and review the linked SOLR-11858 example for the zero-suggestions case. Identify the other invalid parameters and option setters that lack checks, then verify that each rejects invalid input with an appropriate exception and tests cover the cases.

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.