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

Fixed suggestions for a single-word-followed-by-space query #953

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/suggestion.cpp
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ Xapian::Query SuggestionDataBase::parseQuery(const std::string& query)
m_queryParser.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
xquery = m_queryParser.parse_query(query, flags);

if ( !query.empty() && xquery.get_num_subqueries() == 0 ) {
if ( !query.empty() && xquery.empty() ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I was not enough conscientious on the review too.

// a non-empty query string produced an empty xapian query which means
// that the query string is made solely of punctuation.
xquery = Xapian::Query(Xapian::Query::OP_WILDCARD, query);