Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search suggestion is enabled even without full search terms #723

Open
archiloque opened this issue Sep 26, 2023 · 2 comments
Open

Search suggestion is enabled even without full search terms #723

archiloque opened this issue Sep 26, 2023 · 2 comments
Labels

Comments

@archiloque
Copy link
Contributor

In com.sismics.docs.core.util.indexing.LuceneIndexingHandler#findByCriteria I found this code:

        if (!Strings.isNullOrEmpty(criteria.getSimpleSearch()) || !Strings.isNullOrEmpty(criteria.getFullSearch())) {
            // …
            suggestSearchTerms(criteria.getFullSearch(), suggestionList);
        }

It means that if criteria.getSimpleSearch() is filled and criteria.getFullSearch() is null, suggestSearchTerms is called with a null parameter. It feels wrong => in this case should the suggestion search be skipped ?

@jendib
Copy link
Member

jendib commented Oct 8, 2023

You are right, suggestSearchTerms should only be called with a non null "search" parameter, otherwise it will throw NPE inside. Could you do a PR please?

@jendib jendib added the bug label Oct 8, 2023
@archiloque
Copy link
Contributor Author

Thanks, I'll do a PR after #722 is merged to avoid any conflict risk

@archiloque archiloque changed the title Search suggestion is enable even without full search terms Search suggestion is enabled even without full search terms Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants