fix(readme): Update readme to clarify usage of searchable fields retrieval
This commit is contained in:
@@ -203,7 +203,7 @@ class Product extends SmartDataDbDoc<Product, Product> {
|
||||
}
|
||||
|
||||
// List searchable fields
|
||||
const searchableFields = getSearchableFields('Product');
|
||||
const searchableFields = Product.getSearchableFields();
|
||||
|
||||
// 1: Exact phrase across all fields
|
||||
await Product.search('"Kindle Paperwhite"');
|
||||
@@ -230,7 +230,7 @@ await Product.search('');
|
||||
The search functionality includes:
|
||||
|
||||
- `@searchable()` decorator for marking fields as searchable
|
||||
- `getSearchableFields()` to list searchable fields for a model
|
||||
- `Class.getSearchableFields()` static method to list searchable fields for a model
|
||||
- `search(query: string)` method supporting:
|
||||
- Exact phrase matches (`"my exact string"` or `'my exact string'`)
|
||||
- Field‑scoped exact & wildcard searches (`field:value`, `field:Air*`)
|
||||
|
Reference in New Issue
Block a user