# How can I delay HNSW index construction until a segment reaches a target size?

**URL:** <https://discuss.elastic.co/t/how-can-i-delay-hnsw-index-construction-until-a-segment-reaches-a-target-size/383826>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [December 2, 2025, 8:30pm UTC](https://discuss.elastic.co/t/how-can-i-delay-hnsw-index-construction-until-a-segment-reaches-a-target-size/383826 "2025-12-02T20:30:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfmqrb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sfmqrb/32/146005_2.png) [@sfmqrb](https://discuss.elastic.co/u/sfmqrb)\
**Post date:** [December 2, 2025, 8:31pm UTC](https://discuss.elastic.co/t/how-can-i-delay-hnsw-index-construction-until-a-segment-reaches-a-target-size/383826/1 "2025-12-02T20:31:00Z")

</div>

I’m trying to tune vector indexing behavior. Specifically, I want the first HNSW index for a segment to be built **only after the segment reaches a certain size** (e.g., X MB or Y vectors), instead of building small HNSW graphs early.

Is there any setting in Elasticsearch or Lucene that controls this threshold?  
If not, is this behavior hardcoded, and would exposing such a knob be feasible?

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [December 3, 2025, 7:38pm UTC](https://discuss.elastic.co/t/how-can-i-delay-hnsw-index-construction-until-a-segment-reaches-a-target-size/383826/2 "2025-12-03T19:38:50Z")

</div>

This type of knob was added recently to Apache Lucene: [https://github.com/apache/lucene/pull/14963](https://github.com/apache/lucene/pull/14963)

However, its currently not released. Once Apache Lucene does another release (10.4), we will update Elasticsearch, exposing this setting as a index mapping option for HNSW indices.
