The GnemesSearchBundle adds support for a database and elasticsearch word search in Symfony2. It is easy to extend and add new providers
Features include:
- Search text in files stored in Doctrine ORM or Elasticsearch
- Unit tested
This bundle is under development, so for now you have to add the github repository to your composer.json file:
"repositories" : [{
"type" : "vcs",
"url" : "https://github.com/gnemes/gnemes-search-bundle.git"
}],
And then just add the dependency in the require section:
"gnemes/searchbundle": "dev-master"
Then you must add the bundle configuration in your config.yml file:
gnemes_search:
source: orm # orm or elastic
You can use it from its web interface or via console command
Link the web/ folder to your document root. For example
ln -s /path/to/your/project/web /path/to/htdocs/search
And then browse to
http://<IP_ADDR>/search/gnemes/
Here enter the text you want to search in the form.
Use this command to search
php bin/console gnemes:search "Text you want to search"
If you want the bundle to perform a DB fulltext search, there are a few extra parameters that you need to set in your config file:
gnemes_search:
source: orm
orm:
table: "table_name"
search_field: "field_name"
Where:
table_name: Name of the table you want to use in your search.
search_field: Field name of the given table used to search into.
Also, you must configure the database connection parameters as usual.
Change this to an array, so you could search in multiple tables at once