Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Seal Redisearch Adapter Laravel Package

cmsig/seal-redisearch-adapter

RediSearch adapter for the SEAL search engine. Index and query documents in a Redis Stack instance using RediSearch + RedisJSON. Supports ext-redis/ext-json and DSN-based configuration; note: no GeoBoundingBox or HIGHLIGHT support.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Search Infrastructure Modernization: Enables Laravel applications to adopt RediSearch as a high-performance, cost-effective search backend, reducing reliance on proprietary SaaS solutions (e.g., Algolia, Elasticsearch Cloud). Aligns with trends toward open-source, self-hosted infrastructure for scalability and control.
  • Unified Search Abstraction: Part of the SEAL (Search Abstraction Layer) ecosystem, this package allows PMs to decouple search logic from the backend, enabling seamless backend swaps (e.g., Elasticsearch → RediSearch) without rewriting frontend or business logic. Critical for agile roadmaps and tech debt mitigation.
  • Cost Optimization: Eliminates recurring search provider fees by leveraging Redis, which many Laravel apps already use for caching/sessions. Ideal for budget-conscious startups or high-traffic apps where cloud search costs scale unpredictably.
  • Performance-Critical Use Cases:
    • Real-time search: Sub-10ms latency for autocomplete or live filters (e.g., e-commerce product search).
    • High-throughput apps: Handles thousands of queries/sec with Redis’s in-memory architecture.
  • Roadmap Flexibility:
    • Build vs. Buy: Justifies not building a custom search layer by adopting a battle-tested abstraction (SEAL) with minimal overhead.
    • Phased Adoption: Start with RediSearch for basic search, then expand to Elasticsearch for advanced features (e.g., geo-search, highlights) as needed.
  • Use Cases:
    • E-commerce: Faceted search (e.g., filters by price, category) with typo tolerance.
    • Content Platforms: Blog/article search with synonyms and stemming (e.g., "laravel" → "Laravel PHP").
    • Internal Tools: Developer docs, support ticket search, or analytics dashboards with fast, full-text queries.
    • Hybrid Architectures: Pair with Laravel Scout for Algolia/Meilisearch where RediSearch lacks features (e.g., geo-search).

When to Consider This Package

Adopt if:

  • Your search needs are text-heavy with no complex geo-spatial or vector search requirements.
  • You’re already using Redis (or willing to adopt it) for caching/sessions and want to consolidate infrastructure (reduce operational overhead).
  • Your team prefers open-source over managed services for cost control and data sovereignty.
  • You need sub-millisecond latency for search queries (RediSearch runs in-memory).
  • Your Laravel app uses SEAL or you’re evaluating it for search abstraction (avoids vendor lock-in).
  • Your dataset fits within Redis memory limits (typically <100GB for self-hosted; scale with Redis Cluster if needed).
  • You prioritize simplicity over advanced features (e.g., no need for highlighting or aggregations yet).

Look Elsewhere if:

  • You require geo-search (e.g., "find restaurants within 5km")—use Elasticsearch, PostgreSQL with PostGIS, or Laravel Scout with Algolia.
  • You need highlighting/snippets for search results (track SEAL issue #491 or use a dedicated search engine).
  • Your dataset exceeds Redis memory limits (consider Elasticsearch or a hybrid approach with database full-text search).
  • Your team lacks Redis expertise—operational complexity (e.g., module management, scaling) may outweigh benefits.
  • You’re locked into a third-party search provider with deep integrations (e.g., Algolia’s personalization, Elasticsearch’s ML features).
  • You need vector search (e.g., semantic search, embeddings)—use Weaviate, Pinecone, or Elasticsearch’s knn.

How to Pitch It (Stakeholders)

For Executives (Business/Finance)

"We’re proposing to replace our current search provider [X] with RediSearch, an open-source, high-performance alternative built on Redis. Here’s why this makes sense for [Company]:

  • Cost Savings: Eliminate ~$Y/year in search provider fees while maintaining (or improving) performance.
  • Speed: Achieve sub-100ms response times for search queries, critical for [use case, e.g., checkout conversion, user engagement].
  • Infrastructure Synergy: Leverage Redis, which we already use for caching/sessions, reducing operational complexity.
  • Future-Proofing: Avoid vendor lock-in by using open-source tech with a unified search abstraction layer (SEAL).
  • Risk: Limited to basic search today, but we can phase in advanced features (e.g., geo-search) later as needed. Ask: Approve a 4-week POC to validate performance with our live dataset and compare it to our current solution."*

For Engineering (Tech Leads/Devs)

"This SEAL + RediSearch combo lets us:

  • Unify search across all Laravel apps using a single abstraction layer, reducing duplication.
  • Leverage Redis we already use, simplifying ops and reducing infrastructure sprawl.
  • Avoid custom search code—SEAL handles indexing, queries, and schema management out of the box. Key Trade-offs:
  • No geo/highlighting yet (track SEAL issues), but we can implement workarounds or switch backends later.
  • Requires ext-redis and ext-json PHP extensions (already used in [Project X]). Next Steps:
  1. Benchmark RediSearch against our current search backend (e.g., Algolia, database full-text).
  2. Validate schema migration effort for our top use cases (e.g., products, articles).
  3. Propose a phased rollout starting with non-critical features."*

For Developers (Implementation)

"To integrate RediSearch with SEAL in Laravel:

  1. Install Dependencies:
    composer require cmsig/seal cmsig/seal-redisearch-adapter
    
  2. Configure Redis:
    • Ensure your Redis server has the RediSearch and RedisJSON modules enabled.
    • Update Laravel’s config/database.php to include the Redis connection:
      'redis' => [
          'default' => env('REDIS_CONNECTION', 'redis'),
          'redis' => [
              'host' => env('REDIS_HOST', '127.0.0.1'),
              'password' => env('REDIS_PASSWORD', null),
              'port' => env('REDIS_PORT', 6379),
          ],
      ],
      
  3. Set Up SEAL:
    • Define your schema (e.g., app/Search/Schemas/ProductSchema.php):
      use CmsIg\Seal\Schema;
      
      return Schema::create()
          ->addTextField('name')
          ->addNumericField('price')
          ->addTagField('category');
      
    • Initialize the engine in a service provider:
      use CmsIg\Seal\Engine;
      use CmsIg\Seal\Adapter\RediSearch\RediSearchAdapter;
      use Illuminate\Support\Facades\Redis;
      
      $this->app->singleton('search.engine', function () {
          return new Engine(
              new RediSearchAdapter(Redis::connection()),
              require __DIR__.'/Schemas/ProductSchema.php'
          );
      });
      
  4. Index Data:
    • Use SEAL’s CLI or a Laravel command to index existing data:
      use App\Models\Product;
      use Illuminate\Support\Facades\Bus;
      
      Product::chunk(100, function ($products) {
          Bus::dispatch(new IndexProducts($products));
      });
      
  5. Query Search:
    • Example in a controller:
      use Illuminate\Support\Facades\App;
      
      $results = App::make('search.engine')->search('query')->get();
      

Gotchas:

  • Redis Modules: Double-check that redisearch and redisjson are loaded in your Redis config (redis.conf).
  • Schema Design: SEAL’s schema must match your Laravel models. Use accessors or observers to transform data before indexing.
  • Performance: For large datasets, consider async indexing (e.g., Laravel queues) to avoid timeouts. Feedback: This is early-stage—file issues in SEAL’s repo for missing features or edge cases."*

For Product Managers (Strategic Alignment)

"This package supports our goals to:

  • Reduce cloud costs by moving search in-house (aligned with [Cost Optimization Initiative]).
  • **
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky