Class HnswQueryParams

java.lang.Object
org.zvec.binding.HnswQueryParams
All Implemented Interfaces:
AutoCloseable

public class HnswQueryParams extends Object implements AutoCloseable
High-level wrapper for zvec_hnsw_query_params_t (HNSW search parameters).

Ownership: passing an instance to VectorQuery.setHNSWParams(HnswQueryParams), GroupByVectorQuery.setHNSWParams(HnswQueryParams) or SubQuery.setHNSWParams(HnswQueryParams) transfers ownership to the query (mirroring the C API), and the wrapper becomes inert; close() afterwards is a no-op.

  • Constructor Details

    • HnswQueryParams

      public HnswQueryParams()
      Create HNSW query parameters with the C API defaults (ef=40).
    • HnswQueryParams

      public HnswQueryParams(int ef, float radius, boolean isLinear, boolean isUsingRefiner)
      Create HNSW query parameters.
      Parameters:
      ef - exploration factor during search
      radius - search radius (0 disables radius filtering)
      isLinear - whether to use linear search
      isUsingRefiner - whether to use the refiner
  • Method Details

    • setEf

      public void setEf(int ef)
    • getEf

      public int getEf()
    • setRadius

      public void setRadius(float radius)
    • getRadius

      public float getRadius()
    • setIsLinear

      public void setIsLinear(boolean isLinear)
    • getIsLinear

      public boolean getIsLinear()
    • setIsUsingRefiner

      public void setIsUsingRefiner(boolean isUsingRefiner)
    • getIsUsingRefiner

      public boolean getIsUsingRefiner()
    • destroy

      public void destroy()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable