ElasticaClient is an example user management symfony2 bundle. It is a Restful Api at the backend and uses AngularJs at the front end. It uses Elasticsearch as local storage and Elastica as PHP client for Elasticsearch.
-
You need Elasticsearch installed and make sure that Elasticsearch is running:
$ sudo /etc/init.d/elasticsearch start
-
Clone this project into your server.
-
Run Composer to install the dependencies:
php composer.phar update
-
Go to
/path-to-project/web/bundles/forntend/
folder from Console and run Bower to update dependencies:bower update
-
Create Index and Type in Elasticsearch by adding an example user by running:
curl -XPUT 'http://localhost:9200/elastica/user/1' -d '{ "name" : "John", "email" : "john@test.com", "password" : "test" }'
-
Browse
http://host:port/path-to-project/web/app_dev.php/
Not: You can use different Index and Type in Elasticsearch. For that please change the parameters from /path-to-project/src/ElasticaClient/UserBundle/Resources/config/parameters.yml
and create your Elasticsearch Index and Type.
Browse http://host:port/path-to-project/web/app_dev.php/api/doc
to see Restful api documentation created by Nelmio Api Doc Bundle.