Skip to content

Conversation

@ginkelsoft-development
Copy link
Owner

No description provided.

Updated README with comprehensive documentation for the new minimum
prefix length feature introduced in previous release.

Changes:
- Added min_prefix_length to configuration example
- Created Configuration Options table with all settings
- Added dedicated "Minimum Prefix Length" section with:
  - Clear explanation of the feature
  - Code examples showing behavior
  - Recommended values for different use cases
  - Environment variable configuration
- Updated config example to include all current options

This addresses documentation gap for the minimum prefix length feature
that prevents overly broad searches from short terms.
This feature enables efficient searching across multiple fields in a
single database query, significantly improving performance for complex
search scenarios.

New Scopes Added:
1. encryptedSearchAny() - OR logic across multiple fields
   - Searches same term in multiple fields
   - Returns models where ANY field matches
   - Example: Client::encryptedSearchAny(['first_names', 'last_names'], 'John', 'exact')

2. encryptedSearchAll() - AND logic with field-specific terms
   - Searches different terms in different fields
   - Returns models where ALL fields match their respective terms
   - Example: Client::encryptedSearchAll(['first_names' => 'John', 'last_names' => 'Doe'], 'exact')

Benefits:
- Single database query instead of multiple individual queries
- Reduced database round-trips
- Lower memory footprint
- Better performance at scale
- Supports both exact and prefix search types
- Works with both database and Elasticsearch backends

Test Coverage:
- Added 13 comprehensive tests (BatchQueryTest.php)
- Tests cover OR/AND logic, edge cases, empty inputs
- Performance comparison test validates optimization
- Tests confirm minimum prefix length compliance
- All 89 tests passing (161 assertions)

This addresses performance optimization requirement #1:
batch queries for multiple fields in complex search scenarios.
…y-optimization

add batch query optimization for multiple fields
…-min-prefix-length

docs: add min_prefix_length configuration documentation
Implements a caching layer for encrypted search queries to improve performance by reducing redundant database/Elasticsearch queries.

Features:
- Configurable TTL and enable/disable via config
- Smart cache invalidation based on model updates
- Support for cache tagging (Redis, Memcached, DynamoDB, Octane)
- Automatic cache invalidation when configuration changes
- Fallback for non-tagging cache drivers

Cache keys are generated based on model class, search type, search parameters, and configuration hash to ensure proper cache isolation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ult-caching

add SearchCacheService for caching encrypted search results
@ginkelsoft-development ginkelsoft-development merged commit 5533c03 into main Oct 13, 2025
4 of 8 checks passed
ginkelsoft-development added a commit that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants