Annotation Type Searchable
Keeps a full-text search index in step with an entity on the server.
After a transaction commits, every entity of this type it persisted or
updated is written to the index, and every one it removed is deleted from
it, through the server's search engine (cn1.search.url: Elasticsearch,
OpenSearch, or the application's own database). A transaction that rolls
back changes nothing in the index.
The search document holds the entity's persistent fields, keyed by column
name. When any field is marked SearchField only those fields are indexed,
which keeps a password hash or a token out of a search cluster.
@Entity @Searchable(index = "products")
public class Product {
@Id public long id;
@SearchField public String name;
@SearchField public String description;
String supplierCode;
}
A bulk update or delete statement changes rows, not entities, and is not
reflected in the index. On a device this annotation has no effect.
-
Optional Element Summary
Optional Elements
-
Element Details
-
index
String indexThe index name: lowercase letters, digits,-and_, not starting with-or_. Empty means the entity's table name.- Default:
""
-