<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r" -->

---
title: KNN prefiltering in Manticore Search | daily.dev
description: KNN prefiltering in Manticore Search (available from v19.0.1) integrates attribute filters directly into HNSW graph traversal rather than applying them after...
canonical: https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: KNN prefiltering in Manticore Search | daily.dev
og:description: KNN prefiltering in Manticore Search (available from v19.0.1) integrates attribute filters directly into HNSW graph traversal rather than applying them after...
og:url: https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r
og:image: https://api.daily.dev/og/posts/7jcKZMf7R.png
og:image:alt: KNN prefiltering in Manticore Search
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# KNN prefiltering in Manticore Search

**[Manticore](https://daily.dev/sources/manticoresearch)** · 7 min read · 0 upvotes · 0 comments

## Summary

KNN prefiltering in Manticore Search (available from v19.0.1) integrates attribute filters directly into HNSW graph traversal rather than applying them after the fact. Postfiltering can return fewer results than requested when filters are selective, while prefiltering guarantees k results. Manticore uses three strategies automatically: standard filtered HNSW when most documents match, ACORN-1 (from SIGMOD 2024) when fewer than 60% of documents pass the filter (skipping distance computations for non-matching nodes and expanding through them adaptively), and brute-force linear scan when the filtered subset is tiny enough that scanning is cheaper than graph traversal. The query planner estimates selectivity per-query and per-segment with no manual tuning required. Postfiltering can still be explicitly requested via prefilter=0 when globally closest vectors are needed regardless of result count, and brute-force can be forced with fullscan=1.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://manticoresearch.com/blog/knn-prefiltering/>

## Similar posts on daily.dev

- [KNN early termination in Manticore Search](https://daily.dev/posts/knn-early-termination-in-manticore-search-ubrsu52i4) · Manticore · 0 upvotes · 1 comments
- [Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512](https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo) · Manticore · 0 upvotes · 0 comments
- [Faster KNN index builds in Manticore](https://daily.dev/posts/faster-knn-index-builds-in-manticore-bjesanict) · Manticore · 0 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#deep-learning](https://daily.dev/tags/deep-learning), [#vector-search](https://daily.dev/tags/vector-search), [#manticore-search](https://daily.dev/tags/manticore-search)

[View this post on daily.dev](https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"KNN prefiltering in Manticore Search","url":"https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r"},"datePublished":"2026-04-07T18:01:16.386Z","dateModified":"2026-08-24T06:57:54.603Z","description":"KNN prefiltering in Manticore Search (available from v19.0.1) integrates attribute filters directly into HNSW graph traversal rather than applying them after...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7aeab08de81f223da2283a5c97a4b8de?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7aeab08de81f223da2283a5c97a4b8de?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Manticore","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Manticore","logo":"https://media.daily.dev/image/upload/s--FP5Ea08h--/f_auto/v1754225081/logos/manticoresearch","url":"https://daily.dev/sources/manticoresearch"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,deep-learning,vector-search,manticore-search","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Manticore","item":"https://daily.dev/sources/manticoresearch"},{"@type":"ListItem","position":3,"name":"KNN prefiltering in Manticore Search"}]}
```

