urosj/CScharmTools — pull request #1 by bac (2014-10-02 23:03:38+00:00)
Title: Add examples for setting up analyzers and doing ngram searches with a ds...

This branch adds working examples of using a custom analyzer and provides a DSL query example.

The elasticsearch instance is set up by running ./go.sh

Then a query using the ngram analyzer can be run using httpie like:
http GET ":9200/charmstore/entity/_search" < search_ngram.json

Lessons learned:
* If the query string has a & then it all must be quoted.

* In defining the analyzer entity.json had a misspelling using "analyser" when ES expects "analyzer". Using the former fails silently, which is horrible and very time-consuming.

* entity.json defined charmmeta.name to be a multi-field with two sub-fields: name and ngrams. So to do an ngram search the field must be written as charmmeta.name.ngrams. A non-analyzed search would be written charmmeta.name.name.