Package org.zvec.binding
Class HnswQueryParams
java.lang.Object
org.zvec.binding.HnswQueryParams
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreate HNSW query parameters with the C API defaults (ef=40).HnswQueryParams(int ef, float radius, boolean isLinear, boolean isUsingRefiner) Create HNSW query parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddestroy()intgetEf()booleanbooleanfloatvoidsetEf(int ef) voidsetIsLinear(boolean isLinear) voidsetIsUsingRefiner(boolean isUsingRefiner) voidsetRadius(float radius)
-
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 searchradius- search radius (0 disables radius filtering)isLinear- whether to use linear searchisUsingRefiner- 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:
closein interfaceAutoCloseable
-