Class IndexParams

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

public class IndexParams extends Object implements AutoCloseable
  • Method Details

    • createHNSW

      public static IndexParams createHNSW(MetricType metricType, int m, int efConstruction)
    • createHNSWQuantized

      public static IndexParams createHNSWQuantized(MetricType metricType, int m, int efConstruction, QuantizeType quantizeType)
    • createIVF

      public static IndexParams createIVF(MetricType metricType, int nList, int nIters, boolean useSoar)
    • createFlat

      public static IndexParams createFlat(MetricType metricType)
    • createDiskAnn

      public static IndexParams createDiskAnn(MetricType metricType, int maxDegree, int listSize, int pqChunkNum)
      Create DiskANN index parameters.
      Parameters:
      metricType - distance metric
      maxDegree - graph connectivity (max degree of the Vamana graph)
      listSize - build-time list size (candidate list during construction)
      pqChunkNum - PQ chunk count (0 disables PQ)
    • createDiskAnnQuantized

      public static IndexParams createDiskAnnQuantized(MetricType metricType, int maxDegree, int listSize, int pqChunkNum, QuantizeType quantizeType)
    • createIvfRabitq

      public static IndexParams createIvfRabitq(MetricType metricType, int nlist, int totalBits, int sampleCount)
      Create IVF RaBitQ index parameters.
      Parameters:
      metricType - distance metric
      nlist - number of cluster centers
      totalBits - total bits for RaBitQ quantization
      sampleCount - sample count for training; 0 means use all vectors
    • createVamana

      public static IndexParams createVamana(MetricType metricType, int maxDegree, int searchListSize, float alpha, boolean saturateGraph, boolean useContiguousMemory)
      Create Vamana index parameters.
      Parameters:
      metricType - distance metric
      maxDegree - maximum out-degree
      searchListSize - construction candidate list size
      alpha - RobustPrune alpha factor (e.g. 1.2)
      saturateGraph - force every node to reach max_degree
      useContiguousMemory - allocate a contiguous memory arena
    • createInvert

      public static IndexParams createInvert(boolean enableRangeOpt, boolean enableWildcard)
    • createFTS

      public static IndexParams createFTS(String tokenizerName, String[] filters, String extraParams)
      Create an FTS (full-text search) index parameter set.
      Parameters:
      tokenizerName - tokenizer name, e.g. "standard"
      filters - filter chain, e.g. new String[]{"lowercase"}
      extraParams - optional extra params JSON (may be null)
    • getType

      public IndexType getType()
    • getMetricType

      public MetricType getMetricType()
    • setMetricType

      public void setMetricType(MetricType metricType)
    • getQuantizeType

      public QuantizeType getQuantizeType()
    • setQuantizeType

      public void setQuantizeType(QuantizeType quantizeType)
    • getHNSWM

      public int getHNSWM()
    • getHNSWEfConstruction

      public int getHNSWEfConstruction()
    • setHNSWParams

      public void setHNSWParams(int m, int efConstruction)
    • setIVFParams

      public void setIVFParams(int nList, int nIters, boolean useSoar)
    • getIVFParams

      public int[] getIVFParams()
      Returns IVF params as an array: [nList, nIters, useSoar (0 or 1)].
    • setDiskAnnParams

      public void setDiskAnnParams(int maxDegree, int listSize, int pqChunkNum)
    • getDiskAnnMaxDegree

      public int getDiskAnnMaxDegree()
    • getDiskAnnListSize

      public int getDiskAnnListSize()
    • getDiskAnnPqChunkNum

      public int getDiskAnnPqChunkNum()
    • setIvfRabitqParams

      public void setIvfRabitqParams(int nlist, int totalBits, int sampleCount)
    • getIvfRabitqParams

      public int[] getIvfRabitqParams()
      Returns IVF RaBitQ params as an array: [nlist, totalBits, sampleCount].
    • setVamanaParams

      public void setVamanaParams(int maxDegree, int searchListSize, float alpha, boolean saturateGraph, boolean useContiguousMemory)
    • getVamanaParams

      public Object[] getVamanaParams()
      Returns Vamana params: [maxDegree, searchListSize, alpha, saturateGraph, useContiguousMemory].
    • setVamanaTwoPassBuild

      public void setVamanaTwoPassBuild(boolean twoPassBuild)
      Enable or disable Vamana two-pass graph construction (VAMANA params only).
    • getVamanaTwoPassBuild

      public boolean getVamanaTwoPassBuild()
      Whether Vamana two-pass graph construction is enabled.
    • getInvertParams

      public boolean[] getInvertParams()
      Returns Invert params as an array: [enableRangeOpt, enableWildcard].
    • setInvertParams

      public void setInvertParams(boolean enableRangeOpt, boolean enableWildcard)
    • getFTSParams

      public String[] getFTSParams()
      Returns FTS params as an array: [tokenizerName, filters..., extraParams].
    • destroy

      public void destroy()
    • close

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