Problem
The index mapping always defines code_vector as an indexed dense_vector field:
Even when ENABLE_DENSE_VECTORS is disabled, this mapping can still increase index overhead (storage, indexing CPU) and potentially require extra cluster resources.
Where in code
src/utils/elasticsearch.ts in createIndex() mapping for code_vector.
Suggested fix
Options:
- Only include the
code_vector field mapping when ENABLE_DENSE_VECTORS=true.
- Keep the field but set
index: false unless enabled.
Notes
This is a mapping change; deployments will need a clean reindex to pick it up.
Test plan
- Unit test for
createIndex mapping generation (mock client) verifying code_vector is omitted or non-indexed when disabled.
Problem
The index mapping always defines
code_vectoras an indexeddense_vectorfield:index: trueEven when
ENABLE_DENSE_VECTORSis disabled, this mapping can still increase index overhead (storage, indexing CPU) and potentially require extra cluster resources.Where in code
src/utils/elasticsearch.tsincreateIndex()mapping forcode_vector.Suggested fix
Options:
code_vectorfield mapping whenENABLE_DENSE_VECTORS=true.index: falseunless enabled.Notes
This is a mapping change; deployments will need a clean reindex to pick it up.
Test plan
createIndexmapping generation (mock client) verifyingcode_vectoris omitted or non-indexed when disabled.