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

Elasticsearch Search String Parser Laravel Package

spatie/elasticsearch-search-string-parser

Parse custom search strings into Elasticsearch queries. Supports regex-based directives like status:active or @user, grouping directives, and autocomplete suggestions. Build searches via spatie/elasticsearch-query-builder and get results + directive suggestions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Search Functionality Expansion: Enables advanced, customizable search syntax (e.g., status:active, @mentions) without building a full search engine from scratch.
  • Roadmap for Scalable Search: Justifies investing in Elasticsearch as a backend for search-heavy features (e.g., e-commerce filters, internal tools, or customer support).
  • Build vs. Buy: Avoids reinventing search parsing logic, reducing dev time and technical debt. Leverages Spatie’s battle-tested package (MIT license, active maintenance).
  • Use Cases:
    • Internal Tools: Querying logs, tickets, or user data with flexible syntax (e.g., priority:high @team-lead).
    • Customer-Facing Search: E-commerce filters (e.g., color:red size:xl), help centers, or knowledge bases.
    • Data Exploration: Dashboards or analytics tools with ad-hoc query support.
    • Mentions/Tagging: Parsing @user or #tag syntax for collaboration tools.

When to Consider This Package

  • Adopt if:

    • Your app needs custom search syntax beyond basic keyword matching (e.g., field-specific queries, mentions, or grouped filters).
    • You’re already using Elasticsearch or planning to adopt it for search/relevance.
    • Your team lacks bandwidth to build/maintain a search parser from scratch (regex, query building, and edge-case handling).
    • You want low-code extensibility (add directives via regex without deep Elasticsearch expertise).
    • Auto-completion or suggested queries are a priority for UX.
  • Look Elsewhere if:

    • Your search needs are simple (e.g., only keyword matching with no custom syntax).
    • You’re using a non-Elasticsearch backend (e.g., PostgreSQL full-text search, Algolia, or Meilisearch).
    • Your team has dedicated search engineers who prefer fine-grained control over query generation.
    • You need real-time analytics or vector search (this package focuses on structured query parsing).
    • Compliance or data residency requires a self-hosted or proprietary solution.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us offer powerful, customizable search to users without building a complex system from scratch. For example, a support agent could search tickets with status:open @john.doe priority:high—no training needed. It integrates seamlessly with Elasticsearch (our planned search backend), reduces dev time by 60%+ compared to custom parsing, and future-proofs our search roadmap. The MIT license and Spatie’s track record mean low risk. Let’s use this to accelerate features like advanced filtering in [Product X] or internal tools."

For Engineering:

*"This solves a painful gap: parsing user search queries into Elasticsearch syntax. Instead of writing brittle regex or query builders, we get:

  • Plug-and-play directives (e.g., field:value, @mentions) via regex rules.
  • Integration with Spatie’s query builder for complex logic (e.g., AND/OR grouping).
  • Auto-completion support for better UX (e.g., suggesting status: after typing sta).
  • Minimal maintenance: MIT-licensed, actively updated, and PHP-first.

Trade-offs:

  • Ties us to Elasticsearch (but that’s our plan anyway).
  • Less control than rolling our own, but we gain velocity and reliability.

Proposal: Use this for [use case Y], pair it with the query builder for advanced filters, and extend it for [custom directive Z] via regex. Estimated dev time: 2–4 weeks vs. 3+ months DIY."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport