Antoon Van Dessel
04/03/2026, 6:48 AMis, with a structure like this:
is: {
"active": "true",
"buyable": "true",
"buyable_in_all_b2b_cm": "true",
"buyable_in_all_b2b_ecom": "true",
"buyable_in_all_b2b_lib_ecom": "true",
"buyable_in_all_b2c_ecom": "true",
"hidden": "false",
"home_deliverable_in_all_b2b_cm": "true",
"home_deliverable_in_all_b2b_ecom": "true",
"home_deliverable_in_all_b2b_lib_ecom": "true",
"home_deliverable_in_all_b2c_ecom": "true",
"isactive": "true",
"isbuyable": "true",
"not_orderable_from_central_warehouse_in_all_b2b_cm": "false",
"not_orderable_from_central_warehouse_in_all_b2b_ecom": "false",
"not_orderable_from_central_warehouse_in_all_b2b_lib_ecom": "false",
"not_orderable_from_central_warehouse_in_all_b2c_ecom": "false",
"not_orderable_from_supplier_in_all_b2b_cm": "false",
"not_orderable_from_supplier_in_all_b2b_ecom": "false",
"not_orderable_from_supplier_in_all_b2b_lib_ecom": "false",
"not_orderable_from_supplier_in_all_b2c_ecom": "false",
"priced": "true",
"product": "true",
"visible": "true",
"visible_in_all_b2b_cm": "true",
"visible_in_all_b2b_ecom": "true",
"visible_in_all_b2b_lib_ecom": "true",
"visible_in_all_b2c_ecom": "false"
}
I’ve enabled nested fields so I can filter on values like:
• is.active:=true
• is.buyable:=true
• is.visible:=true
Observed performance
Filtering on a single field (e.g. is.active:=true) takes ~1.1s
Combining multiple filters (e.g. active + buyable + visible) takes up to ~2.2s
• Filtering on a numeric field (price:>0.46) takes ~2.6s
• range_index: true is enabled for this field
Questions
Are these response times expected for a dataset of this size (~16M documents)?
Do nested fields significantly impact filter performance in this case?
Are there recommended optimizations for:
◦ multiple boolean filters
I also have a price field in the index that is a float, I have turned on the range_index on this field. But when I filter on it like price:>0.46 the response takes 2.22sec. Is this normal? Are there ways to improve?
Any guidance or best practices would be greatly appreciated. Thanks! 🙏Fanis Tharropoulos
04/03/2026, 9:09 AMcurl request so we can debug?Antoon Van Dessel
04/03/2026, 9:19 AMFanis Tharropoulos
04/03/2026, 10:20 AMis.active:=true matching ~14M of 16M documents, that means 14M iterations of scoring, ranking, and counting, only to return 10 results. Query time scales linearly with the number of matching documents, not the number of returned results.
Multiple filters combined with && add intersection cost and the result set is still large, explaining the roughly double query time. The numeric price:>0.46 is slowest because the range trie must collect, merge, sort, and de-duplicate all matching IDs before the scoring loop even begins.
I also took a look at your schema, and it's correctly configured. The is.* fields are typed as bool and I confirmed through testing that the filter engine uses the efficient boolean index path. The "true" strings you see in API responses are cosmetic, because when documents are ingested with string values, coercion to boolean applies to the index but not to the stored document. Filtering works correctly regardless. You could try reindexing everything as true JSON boolean values ("is.active": true vs "is.active": "true") just for peace of mind though, as this is an edge case.
There is a fast path in the code for q=* without any filter that returns results in O(page_size) by walking the sequence ID index in reverse and stopping early. This fast path explicitly requires no filter_by, so your queries cannot use it.
If you want to provide a fast initial load, you can use search_cutoff_ms to cap latency. Typesense checks for timeout every ~32K documents and will return partial but correct top results. You should also check out use_cache for caching commonly used queries / pages on the server-side. When it comes down to reducing general response time, narrowing your filters to match fewer documents is the most direct way.Antoon Van Dessel
04/03/2026, 10:49 AMFanis Tharropoulos
04/03/2026, 11:11 AMq=* without any filters is going to be the fastest. By the way, is.active:=true matches ~14M out of the 16M total documents. If it's commonly applied, then breaking the collection into two, one for active and one for inactive documents will increase performance by a lot, since the filtering won't be needed during search time.
The 1-2 second response time is a result of filters matching millions of documents, not of using q=* itself. A text query like q=shoe with the same filter would actually be faster because the text search narrows the candidate set before the filter is applied, meaning fewer documents go through the loop.Antoon Van Dessel
04/03/2026, 11:16 AMAntoon Van Dessel
04/03/2026, 11:26 AMFanis Tharropoulos
04/03/2026, 12:19 PMvisible,active,buyable? Or do they coexist to avoid data duplication?Fanis Tharropoulos
04/03/2026, 12:20 PMAntoon Van Dessel
04/03/2026, 12:21 PMFanis Tharropoulos
04/03/2026, 12:38 PMAntoon Van Dessel
04/03/2026, 12:39 PMFanis Tharropoulos
04/03/2026, 12:40 PMFanis Tharropoulos
04/03/2026, 12:42 PMYes, so the correct question would be if it is better to use >0.46 or [0.46..1000]?
Depends, if your maximum price number is 1000, then it would be the equivalent. But using it will add an additional layer of filtering, like saying
price:>=0.46 && price:<=1000. If 1000 is not the maximum, then it may be fasterAntoon Van Dessel
04/03/2026, 12:45 PMFanis Tharropoulos
04/03/2026, 2:28 PMfacet_sample_percent=50 to your query. It computes facets from a sample instead of all matches, giving you faster results with representative counts that are automatically scaled up. You can combine both parameters and adjust to balance speed and accuracy.Antoon Van Dessel
04/08/2026, 6:05 AMFanis Tharropoulos
04/08/2026, 1:35 PMis.active:=true is slower because it still matches almost the whole collection, so even though the filter itself is cheap, the query still has to process a very large number of matching docs. When you combine the 200k filter with is.active:=true, the result is faster than is.active alone because the selective filter cuts the candidate set down a lot. It is still slower because 200k is still not a small set, just much smaller than 15M. TLDR, it's not about how many filters there are, but how many docs are retrieved when they're applied.
Creating a separate cluster or collection for the active / buyable / in-collection subset will improve latency a lot, since it removes these very broad filters from the query path. But if the data is mostly duplicated, RAM usage will also go up a lot. It won't be a small overhead if you're planning to keep both indexed, rather than deleting the documents that match the "separate cluster" criteria.
On the bitmask idea, I would not expect a big optimization, unless it also makes the matched set much smaller, which I presume it won't. Replacing 3 boolean filters with 1 integer filter can reduce some filter-combination work, but that is usually not the dominant problem here. If the bitmask value still matches millions of documents, the query will still be slow. So I’d see bitmasking as a modest optimization, not the thing that will change query times dramatically. I would start by testing it out first, before taking more drastic measures like duplicating the dataset in an "active" collection.Antoon Van Dessel
04/09/2026, 6:26 AMAntoon Van Dessel
04/10/2026, 6:48 AMJonathan King
04/13/2026, 12:09 AM&& logic is adding about 300ms extra time just to process the intersections (if you look at the larger sets 1.1->1.4/1.36 is also around 300ms added); not sure if it should be taking this long but it makes sense that there is some overhead. Given this your bitwise mask idea may help the search times yes, it would be worth trying out.Antoon Van Dessel
04/13/2026, 8:07 AMFanis Tharropoulos
04/14/2026, 9:08 AM