Download the PHP package hosmelq/search-syntax-parser without Composer

On this page you can find all versions of the php package hosmelq/search-syntax-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package search-syntax-parser

Search Syntax Parser

Parse search queries into structured data with support for field searches, boolean logic, range comparisons, and multiple output formats.

Introduction

Use a concise, expressive query language to build structured queries. It supports field-specific searches, boolean operators, ranges, existence checks, and multi-value lists, and outputs to multiple formats via adapters.

It returns a normalized PHP array describing the query.

Requirements

The package is framework-independent and can be installed alongside Laravel 12 and 13.

Installation & setup

Install the package via composer:

Basic usage

Getting started

Create a parser from a query string and build it using the default array adapter:

Default adapter (array)

When no adapter is provided, build() uses the array adapter and returns a structured PHP array.

Query types

Connectives (AND/OR)

Combine multiple terms with logical operators. When no connective is specified, AND is implied.

Comparators

Use field comparison operators to define the relationship between a field and its value:

Comma-separated values

Use multi-value field searches as syntactic sugar for OR operations:

Exists queries

Search for documents with non-null values in specified fields using wildcard syntax:

Range queries

Search within value ranges using boundary operators:

Terms

Search using basic terms that match default searchable fields:

Modifiers (NOT)

Negate terms or subqueries using - or NOT:

Field validation

Restrict which fields can be used and validate their values using AllowedField helpers:

You can also map external field names to internal ones:

Array item validation (each and at)

For array fields, use each() to validate every item and at(index) to validate specific positions.

Per‑item rules with each():

Index‑specific rules with at() (tuple‑like arrays):

Custom adapters

Create custom output formats by implementing the adapter interface:

Error handling

Handle parsing errors with ParseException:

Testing

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of search-syntax-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
archtechx/enums Version ^1.1
brick/math Version ^0.14.2 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^0.20 || ^1.0
doctrine/lexer Version ^3.0
thecodingmachine/safe Version ^3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hosmelq/search-syntax-parser contains the following files

Loading the files please wait ...