Creating a Search Projection
Guide to creating a search projection for indexing your data. Configure searchable, filterable, sortable, and facetable attributes, and understand drift detection between your search configuration and the underlying model.
A search projection maps your model entities to search index fields. Each property can be configured with search-specific attributes that control how data is indexed and queried. The search profile determines the target platform (Elasticsearch, Azure Cognitive Search, etc.) and resolves field types accordingly.
Search Field Attributes
Each property in a search projection can carry the following attributes:
| Attribute | Purpose | When to Use |
|---|---|---|
| Searchable | Include field in full-text search queries | Text fields that users search by keyword (titles, descriptions, body text) |
| Filterable | Allow exact-match and range filtering | Fields used in faceted navigation or WHERE-style clauses (status, category, date ranges) |
| Sortable | Allow results to be ordered by this field | Fields users sort by (date, price, name, relevance score) |
| Facetable | Generate aggregation counts for this field | Fields shown as filter options with counts (categories, tags, status values) |
| Retrievable | Include field in search results | Fields displayed in result listings (most fields, but exclude large text that is only searched) |
Step-by-Step Guide
Drift Detection
Over time, your model may change - new properties added, types modified, entities renamed. The search projection tracks these changes and highlights drift between the current model and your search configuration.