PHP Classes

Vegvisir Laravel Search Indexer: Adaptable search for model objects

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 30 All time: 11,119 This week: 673Up
Version License PHP version Categories
vegvisir 1.0MIT/X Consortium ...5PHP 5, Searching, Libraries, Design P...
Description 

Author

This package implements a universal search for model objects.

It implements a service for Laravel-based applications that can index and perform searches for model objects using query strings.

The package can call adapter classes that support different search indexers to access the model objects that applications may want to search.

Currently, it supports search index adapters like:

- Elastic Search

- MongoDB

Innovation Award
PHP Programming Innovation award nominee
August 2022
Number 3
Laravel is a popular PHP framework that implements the Model-View-Controller (MVC) design pattern.

Application objects are stored in persistent containers using model classes. Usually, these model classes use SQL database servers to store the model objects.

This solution may be acceptable when you want to store a relatively small number of model objects in database table records.

If your application needs to store and retrieve many model objects, other types of containers do not use SQL to query the database records, so it can be faster to search the object records.

This package provides a general solution to search model class objects in different storage containers that are more suited to store a large number of model class objects, like Elastic Search and Mongo DB.

Since this package provides an interface abstraction to perform searches for model objects, it is easier to change an application to use a different storage container without changing the database code.

Manuel Lemos
Picture of Thiago Przyczynski
  Performance   Level  
Name: Thiago Przyczynski <contact>
Classes: 16 packages by
Country: Brazil Brazil
Age: 35
All time rank: 3194238 in Brazil Brazil
Week rank: 192 Up14 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 8x

Documentation

Vegvisir - Laravel Search Indexer

PHPUnit

Table of contents

Installation

Install it using composer on your application: composer require thiagoprz/vegvisir

Configuration

Install chosen AdapterServiceProvider (see adapters for more information) service provider to config/app.php:

..
'providers' => [
...
    \Thiagoprz\Vegvisir\VegvisirElasticSearchServiceProvider::class,
],
...

Publish configuration by running php artisan vendor:publish and typing the number for your desired adapter (if using multiple adapters there's no need for running more than once, just choose one of them).

This will add the vegvisir.php file to the config directory. Bear in mind that this configuration contains directives for all adapters inside your application, those you don't need multiple configurations files for each adapter you use in case your application will be using more than one.

Available Adapters

This package comes with built-in Adapters that can be easily use without any customization depending on your needs, of course you can and are encouraged to build your own Adapter to fill any specification or if you are using a different platform that the ones listed here.

Elasticsearch

This adapter connects to Elasticsearch host(s) and will insert/update/delete everytime changes happen to your model.

Follow the instructions in the adapter repository.

MongoDB

> Status: Under Development

This adapter connects to MongoDB and will insert/update/delete everytime changes happen to your model.

Follow the instructions in the adapter repository.

Create You Own Adapter

The main idea behind this project is to allow enhancing Laravel applications by using different databases from the main one (usually MySQL) as the entry point for search requests, those providing a better preformance and avoiding performance issues for large operations on the database. Based on this idea this repository will be useful for anyone who wants to implement their own search tool inside laravel application, it's really straight forward to create an adapter by following this steps.

Adapter Package Structure

  • src/ - Adapters/ - CustomAdapter.php - config/ - vegvisir.php - Repositories/ - CustomRepository.php - CustomServiceProvider.php

Roadmap

  • Implement as mush sustainable as possible the most diverse numbers of adapters for enhancing Laravel Application

| Adapter | STATUS | Release Version | Engine Version¹ | |-----------------------------------|-------------|-----------------|-----------------| | Elastic Search | Done | 0.0.1 | 7.11.0 | | MongoDB | In Progress | | | | MySQL | Todo | | | | Cassandra/ScyllaDB | Todo | | | | SQLite | Todo | | |

¹ Engine version means the version of the software used to build the package, there is a possibility that depending on the changes (specially breaking changes) made on the Third Party this package may not be stable or not work as expected.

Contributing

Testing

vendor/phpunit/phpunit/phpunit --configuration phpunit.xml tests

Support

Issues

Please feel free to create issues on this package, it will help a lot. I will address it as soon as possible.

License

This package is licensed under the MIT license.

<img width="36" height="36" src="assets/Vegvisir.svg">


  Files folder image Files (13)  
File Role Description
Files folder imageassets (1 file)
Files folder imagesrc (1 file, 5 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file License.txt Doc. Documentation
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (13)  /  assets  
File Role Description
  Accessible without login Plain text file Vegvisir.svg Data Auxiliary data

  Files folder image Files (13)  /  src  
File Role Description
Files folder imageconfig (1 file)
Files folder imageExceptions (1 file)
Files folder imageInterfaces (2 files)
Files folder imageObservers (1 file)
Files folder imageTraits (1 file)
  Plain text file VegvisirServiceProvider.php Class Class source

  Files folder image Files (13)  /  src  /  config  
File Role Description
  Accessible without login Plain text file vegvisir.php Aux. Auxiliary script

  Files folder image Files (13)  /  src  /  Exceptions  
File Role Description
  Plain text file AdapterException.php Class Class source

  Files folder image Files (13)  /  src  /  Interfaces  
File Role Description
  Plain text file AdapterInterface.php Class Class source
  Plain text file RepositoryInterface.php Class Class source

  Files folder image Files (13)  /  src  /  Observers  
File Role Description
  Plain text file VegvisirObserver.php Class Class source

  Files folder image Files (13)  /  src  /  Traits  
File Role Description
  Plain text file Searchable.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:30
This week:0
All time:11,119
This week:673Up