java.lang.Object
com.datastax.astra.client.core.hybrid.Hybrid

public class Hybrid extends Object
Hybrid object that can be used to store both vector and lexical information.
  • Constructor Details

    • Hybrid

      public Hybrid()
      Default constructor.
    • Hybrid

      public Hybrid(String text)
      Constructor with text.
      Parameters:
      text - text to use
    • Hybrid

      public Hybrid(Document doc)
      Constructor with custom document.
      Parameters:
      doc - document to use
  • Method Details

    • vectorize

      public Hybrid vectorize(String vectorize)
      Add a vectorize field.
      Parameters:
      vectorize - vectorize to use
      Returns:
      this
    • vectorize

      public Hybrid vectorize(Vectorize vectorize)
      Add a vectorize field.
      Parameters:
      vectorize - vectorize to use
      Returns:
      this
    • lexical

      public Hybrid lexical(String lexical)
      Add a lexical field.
      Parameters:
      lexical - lexical to use
      Returns:
      this
    • lexical

      public Hybrid lexical(Lexical lexical)
      Add a lexical field.
      Parameters:
      lexical - lexical to use
      Returns:
      this
    • vector

      public Hybrid vector(float[] embeddings)
      Add a vector that will be serialized as a float array.
      Parameters:
      embeddings - embeddings to use
      Returns:
      this
    • vector

      public Hybrid vector(DataAPIVector vector)
      Add a vector that will be serialized as a base64 encoded string..
      Parameters:
      vector - vector to use
      Returns:
      this