This bundle should to be installed with Composer The process vary slightly depending on if your application uses Symfony Flex or not.
Following instructions assume you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
composer require versh23/manticore-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require versh23/manticore-bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Versh23\ManticoreBundle\Versh23ManticoreBundle(),
);
// ...
}
// ...
}
Create configuration file config/packages/manticore.yaml
versh23_manticore:
host: 'manticore'
port: 9306
indexes:
my_entity:
class: App\Entity\MyEntity
fields:
description: ~ #short syntax
name: #full syntax
property: name
attributes:
free: bool #short syntax
status: #full syntax
property: status
type: string
In this example will be created a manticore.index_manager.article
service that allow to manipulate index manticore.index.article
- truncate index (
truncateIndex()
) - flush index (
flushIndex()
) - replace/insert/delete operations (
replace()
,insert()
,delete()
,bulkReplace()
,bulkInsert()
) - create a Pagerfanta object (
findPaginated()
) https://github.com/whiteoctober/Pagerfanta - simple find objects (
find()
) - create custom query by SphinxQL syntax (
createQuery
)
For App\Entity\MyEntity
will be created Event listener manticore.listener.article
thats allow update your RT index my_entity
There are two useful commands:
manticore:index:config
- render config samplemanticore:index:populate
- populate RT index