Annotation Interface ApproximateSearch


@Documented @Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) public @interface ApproximateSearch
Marks a vector search method as approximate, so the database may answer the top-K query from a vector index instead of comparing every row.

On Oracle the row limit of the query is rendered as FETCH APPROX FIRST n ROWS ONLY, optionally WITH TARGET ACCURACY p. The limit comes from the method name, such as searchTop5By..., or from a Limit or Pageable argument. A query with an offset keeps the exact row limit. Other dialects ignore the annotation; PostgreSQL, for example, uses a pgvector index for an ordered, limited query without extra syntax.

Since:
5.3.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The target accuracy, as a percentage from 1 to 100, or 0 to use the accuracy of the vector index.
  • Element Details

    • targetAccuracy

      int targetAccuracy
      The target accuracy, as a percentage from 1 to 100, or 0 to use the accuracy of the vector index.
      Returns:
      The target accuracy
      Default:
      0