Interface Vectorize

All Superinterfaces:
org.teavm.jso.JSObject

public interface Vectorize extends org.teavm.jso.JSObject
A Vectorize index. Declared with vectorize(), named VECTORIZE by default.

No local emulation exists, so a test either fakes this binding or points it at the real index.

Since:
1.0.0
  • Method Details

    • query

      default TSObject query(double[] vector, int topK)
      Finds the nearest vectors.
      Parameters:
      vector - the query vector
      topK - how many matches to return
      Returns:
      the matches, ordered nearest first
    • query

      default TSObject query(double[] vector, int topK, TSObject options)
      Finds the nearest vectors, returning their metadata and values too.
      Parameters:
      vector - the query vector
      topK - how many matches to return
      options - returnValues, returnMetadata, filter, namespace
      Returns:
      the matches
    • insert

      default TSObject insert(TSObject... vectors)
      Adds vectors, failing on an id that already exists.
      Parameters:
      vectors - each carrying id, values and optionally metadata
      Returns:
      the write's outcome
    • upsert

      default TSObject upsert(TSObject... vectors)
      Adds or replaces vectors.
      Parameters:
      vectors - each carrying id, values and optionally metadata
      Returns:
      the write's outcome
    • getByIds

      default TSObject getByIds(String... ids)
      Reads vectors by id.
      Parameters:
      ids - the ids
      Returns:
      the vectors that exist
    • deleteByIds

      default TSObject deleteByIds(String... ids)
      Removes vectors by id.
      Parameters:
      ids - the ids
      Returns:
      the deletion's outcome
    • describe

      default TSObject describe()
      Returns the index's dimension, metric and vector count.
      Returns:
      the index's dimension, metric and vector count
    • runQuery

      org.teavm.jso.core.JSPromise<TSObject> runQuery(org.teavm.jso.core.JSArray<TSObject> vector, TSObject options)
    • insertVectors

      org.teavm.jso.core.JSPromise<TSObject> insertVectors(org.teavm.jso.core.JSArray<TSObject> vectors)
    • upsertVectors

      org.teavm.jso.core.JSPromise<TSObject> upsertVectors(org.teavm.jso.core.JSArray<TSObject> vectors)
    • fetchByIds

      org.teavm.jso.core.JSPromise<TSObject> fetchByIds(org.teavm.jso.core.JSArray<TSObject> ids)
    • removeByIds

      org.teavm.jso.core.JSPromise<TSObject> removeByIds(org.teavm.jso.core.JSArray<TSObject> ids)
    • describeIndex

      org.teavm.jso.core.JSPromise<TSObject> describeIndex()