Interface IndexUpdater

All Superinterfaces:
ArrayInterface, AutoCloseable, Iterable<Object>

public interface IndexUpdater extends ArrayInterface, Iterable<Object>, AutoCloseable
Enterprise Only

IndexUpdater used for updating the index in lazy mode. Currently, the vector index is the only index type that can be updated lazily.

Note!!

The finish() function implicitly closes the IndexUpdater if it succeeds. Use of a closed IndexUpdater or any container (Dict or Array) obtained from it will throw an CouchbaseLiteError.

  • Method Details

    • setVector

      void setVector(@Nullable List<Float> value, int index) throws CouchbaseLiteException
      Sets the vector for the value corresponding to the index. Setting null value means that there is no vector for the value, and any existing vector will be removed when the finish() is called.
      Parameters:
      value - the vector.
      index - the index at which to place the vector.
      Throws:
      CouchbaseLiteException
    • skipVector

      void skipVector(int index)
      Skip setting the vector for the value corresponding to the index. The vector will be required to compute and set again for the value when the QueryIndex's beginUpdate() is later called for updating the index.
    • finish

      void finish() throws CouchbaseLiteException
      Updates the index with the computed vectors and removes any index rows for which null vector was given. If there are any indexes that do not have their vector value set or are skipped, a CouchbaseLiteException will be thrown.

      Note: Before calling the finish() function, the set vectors are kept in the memory.

      Throws:
      CouchbaseLiteException
    • close

      void close()
      Close the updater without a checked exception
      Specified by:
      close in interface AutoCloseable