Download the PHP package ayaou/db-search-bundle without Composer

On this page you can find all versions of the php package ayaou/db-search-bundle. 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 db-search-bundle

🔍 DB Search Bundle

📌 Overview

The DB Search Bundle helps you search text inside your database using Doctrine and Symfony.

✅ No need for Elasticsearch or other search engines!

✅ Works with your existing database!

⚠️ This is a simple and lightweight search solution for small to medium-sized projects. It does not support advanced features like fuzzy matching or search ranking.

📥 Installation

First, install the bundle using Composer:

Then, create the database table for indexing:

🗃️ Database Schema

The migration creates a table called db_search_index. Here is an example for MySQL/MariaDB:

⚙️ Configuration

Define your indexes and entities in config/packages/db_search.yaml:

⚠️ Important: Each entity must have a getId() method that returns a unique ID.

🏷️ Indexing Rules

✅ You can create multiple indexes for different entities or fields.

✅ Each entity can have multiple fields indexed.

✅ Fields can be public properties or public methods.

✅ Indexed fields must return text, numbers, or boolean values (string, int, float, bool).

🔎 How Indexing & Search Works

For each field you configure in an entity, the bundle will:

  1. Take the field values.
  2. Concatenate them into one long text string, separated by spaces.
  3. Store the result in the indexed_text column.

When you search for a keyword, the bundle will:

  1. Look for the keyword inside the indexed_text column.
  2. Return matching results based on the index configuration.

🔎 Usage

Searching the Database

Use the Searcher service (@db_search.searcher) to search in the database:

Regenerating the Search Index

Use the db-search:index:regenerate command to purge and rebuild the index for specific entities or indexes.

Reindex Everything

Reindex a Specific Index

Reindex a Specific Entity

Reindex a Specific Entity in a Specific Index

🏷️ This command purges existing index entries before reindexing.

🌟 Features

Fast Search: Uses full-text search when available.

Flexible Indexing: Supports multiple indexes and entities.

Customizable: You can modify search behavior using Symfony services.

🔮 Future Improvements

🔹 Support for More Databases like PostgreSQL, SQLServer, Oracle.

🔹 Faster indexation with asynchronous indexing using Symfony Messenger.

🔹 Smarter Search with phonetic matching and synonyms.

🔹 Better Ranking to show more relevant results first.


💡 Contributions Welcome!

If you find a bug or have an idea for improvement, please create an issue or pull request. 🚀


All versions of db-search-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
symfony/console Version ^6.4
symfony/event-dispatcher Version ^6.4
symfony/dependency-injection Version ^6.4
doctrine/doctrine-bundle Version *
doctrine/orm Version *
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 ayaou/db-search-bundle contains the following files

Loading the files please wait ...