Skip to content

enhancement: make code_vector mapping conditional when ENABLE_DENSE_VECTORS is false #140

@kapral18

Description

@kapral18

Problem

The index mapping always defines code_vector as an indexed dense_vector field:

  • index: true

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:

  1. Only include the code_vector field mapping when ENABLE_DENSE_VECTORS=true.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions