O'Reilly logo
  • Topher Hunt thinks this is interesting:

In order to see what was indexed in the title field for the Elasticsearch Server phrase, we will run the following command:

curl -XGET 'localhost:9200/books/_analyze?field=title' -d 'Elasticsearch Server'


Cover of Elasticsearch Server Second Edition


Once I have ElasticSearch running, I can run CURL commands against it to debug what responses I get from it. That maybe useful when troubleshooting issues in the elasticsearch-rails gem: I can differentiate between what ES is returning and what the gem is returning.

This particular command is a debug query: it returns an explanation of what tokens were matched and how they're treated.