diff --git a/src/query/query_parser.cpp b/src/query/query_parser.cpp index 7ecb7048..02bc5106 100644 --- a/src/query/query_parser.cpp +++ b/src/query/query_parser.cpp @@ -1,5 +1,7 @@ -#include "query/query_parser.hpp" +#include + #include "query/queries.hpp" +#include "query/query_parser.hpp" namespace pisa { @@ -13,6 +15,8 @@ auto QueryParser::parse(std::string_view query) -> Query { for (auto token: *tokens) { if (auto id = (*m_term_map)(token); id) { query_ids.push_back(*id); + } else { + spdlog::warn("Term `{}` not found and will be ignored", token); } } return {std::move(id), std::move(query_ids), {}}; diff --git a/src/token_filter.cpp b/src/token_filter.cpp index 278d286a..25e9d0ac 100644 --- a/src/token_filter.cpp +++ b/src/token_filter.cpp @@ -1,8 +1,7 @@ -#include "pisa/token_filter.hpp" - -#include - #include +#include + +#include "pisa/token_filter.hpp" namespace pisa { @@ -60,6 +59,7 @@ auto StopWordRemover::filter(std::string_view input) const -> std::unique_ptr std::unique_ptr { if (m_stopwords.find(input) != m_stopwords.end()) { + spdlog::warn("Term `{}` is a stopword and will be ignored", input); return std::make_unique(); } return std::make_unique(std::move(input));