diff --git a/README.md b/README.md index 0b7b6a7e..3a11877a 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,17 @@ **Discover available filters and scale to millions of items!** ```javascript -// Discover what filters are available +// Discover what filters are available - O(1) field lookup const categories = await brainy.getFilterValues('category') // Returns: ['electronics', 'books', 'clothing', ...] -const fields = await brainy.getFilterFields() +const fields = await brainy.getFilterFields() // O(1) operation // Returns: ['category', 'price', 'brand', 'rating', ...] ``` -- ✅ **Filter Discovery API**: See what values are available for filtering +- ✅ **Filter Discovery API**: O(1) field discovery for instant filter UI generation - ✅ **Improved Performance**: Removed deprecated methods, now uses pagination everywhere -- ✅ **Better Scalability**: Hybrid indexing approach handles millions of items +- ✅ **Better Scalability**: Hybrid indexing with O(1) field access scales to millions - ✅ **Smart Caching**: LRU cache for frequently accessed filters - ✅ **Zero Configuration**: Everything auto-optimizes based on usage patterns diff --git a/docs/api-reference/search-methods.md b/docs/api-reference/search-methods.md index e15368b8..0a88c61d 100644 --- a/docs/api-reference/search-methods.md +++ b/docs/api-reference/search-methods.md @@ -431,14 +431,14 @@ Brainy validates metadata queries and provides helpful error messages: ### getFilterValues(field) -Get all available values for a specific field that can be used in filters: +Get all available values for a specific field with O(1) field lookup: ```javascript -// Get all categories in the database +// Get all categories in the database - O(1) field access const categories = await brainy.getFilterValues('category') // Returns: ['electronics', 'books', 'clothing', 'home', ...] -// Get all brands +// Get all brands - O(1) field lookup + O(n) value retrieval const brands = await brainy.getFilterValues('brand') // Returns: ['apple', 'samsung', 'sony', ...] @@ -453,10 +453,10 @@ const results = await brainy.search("products", 10, { ### getFilterFields() -Get all fields that have been indexed and can be used for filtering: +Get all fields that have been indexed - O(1) operation: ```javascript -// Discover what fields are available +// Discover what fields are available - O(1) direct access const fields = await brainy.getFilterFields() // Returns: ['category', 'price', 'brand', 'rating', 'tags', ...]