From adf9e865847f18ab35ec89bd8b6e7a4efb086f15 Mon Sep 17 00:00:00 2001 From: glmdev Date: Fri, 8 Jul 2016 21:44:31 -0500 Subject: [PATCH] add README --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..29edc3a --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# element/search +This is a simple hit based search engine for Eloquent models. It can take a string and will search the given set of models for each word in that string. +It prioritizes models based on the number of times each word in the search string is found in the searchable fields in the model, with more emphasis +on longer words, and less on shorter. + +## Installation +Element Search is available on composer. To install, simply run: +``` bash +composer require element/search +``` + +## Use + +Making your models searchable is easy. The models simply need to implement the ```php Element\Search\SearchableContract ``` +interface. Then, add the `getSearchable()` method to the model. This method should return an array of the names +of the Model's fields that the search engine can search. These fields should hold string/text data only. + +For Example: + +``` php +