Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 include/pisa/intersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace intersection {
/// Returns a filtered copy of `query` containing only terms indicated by ones in the bit mask.
[[nodiscard]] inline auto filter(Query const& query, Mask const& mask) -> Query {
if (query.terms().size() > MAX_QUERY_LEN) {
throw std::invalid_argument("Queries can be at most 2^32 terms long");
throw std::invalid_argument("Queries can be at most 2^31 terms long");
}
std::vector<std::uint32_t> terms;
std::vector<float> weights;
Expand Down
6 changes: 6 additions & 0 deletions tools/compute_intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ void intersect(

auto print_intersection = [&](auto const& query, auto const& mask) {
auto intersection = Intersection::compute(index, wdata, scorer, query, mask);
if (0U == intersection.length) {
return;
}
std::cout << fmt::format(
"{}\t{}\t{}\t{}\n",
query.id() ? *query.id() : std::to_string(qid),
Expand All @@ -62,6 +65,9 @@ void intersect(
for_all_subsets(query, max_term_count, print_intersection);
} else {
auto intersection = Intersection::compute(index, wdata, scorer, query);
if (0U == intersection.length) {
continue;
}
std::cout << fmt::format(
"{}\t{}\t{}\n",
query.id() ? *query.id() : std::to_string(qid),
Expand Down