The entity the decorator is applied to, extending DynaRecord.
The type of the decorated property, which must carry the Searchable brand.
A class field decorator function that registers the searchable mark with the ORM's metadata system, reconciled at metadata initialization.
Usage example:
@Entity
class Listing extends MyTable {
declare readonly type: "Listing";
@Searchable()
@StringAttribute({ alias: "Description" })
public readonly description: Searchable;
}
The nullable variant — the property stays optional, and a row without a value carries no vector and is absent from the index until one is written:
@Entity
class Article extends MyTable {
declare readonly type: "Article";
@Searchable()
@StringAttribute({ alias: "Summary", nullable: true })
public readonly summary?: Searchable;
}
A layered decorator marking a string attribute as the entity's searchable text for vector search. Stack it over a string attribute decorator; the base decorator continues to own the attribute's alias, nullability, and validation —
@Searchable()only adds the searchable mark.The decorated property must carry the Searchable brand — applying the decorator to a plain
stringproperty is a compile error. The brand alone confers nothing; without the decorator the attribute is a normal string attribute.IMPORTANT! - An entity may declare at most one searchable attribute. This is enforced at metadata initialization, together with the requirement that the layered-over attribute is a string attribute.