elasticsearch. community

I have a problem. What do I do?

There is a strong, helpful community of users on the user mailing list and on IRC who are happy to help you sort out any issues.

If something is not working, there are two possibilities:

  1. there is a bug
  2. you are doing something wrong

Whichever it is, a clear description of the problem will help other users to help you.

The best thing to do is to gist a simple, complete curl recreation of the issue. That way, any user can recreate your problem locally.

What is a curl recreation?

curl is a command line program which can talk to an ElasticSearch server over http. All of the code examples in the ElasticSearch guide are provided as curl statements.

For example:

    curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true'
    {
      "cluster_name" : "MyCluster",
      "status" : "yellow",
      "timed_out" : false,
      "number_of_nodes" : 1,
      "number_of_data_nodes" : 1,
      "active_primary_shards" : 25,
      "active_shards" : 25,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 25
    }

How do I create a curl example?

You can just type the command into the command line and copy and paste the output.

Tips

  • Use ?pretty=true - it makes it easier to read the output
  • Change the actual server to localhost:9200 or 127.0.0.1:9200 rather than elasticsearch.mydomain.com - it makes it easier for other users to run your example, without having to edit it first.
  • It is always better to include your mapping in the example.

Other APIs

If you use the Perl API, ElasticSearch.pm, you can log your commands in a suitable format:

    use ElasticSearch();
    $es = ElasticSearch->new(servers=>'127.0.0.1:9200');

    $es->trace_calls(1);            # log to STDERR
    # $es->trace_calls('example');  # or log to a file

    $es->cluster_health();

Outputs:

    curl -XGET 'http://127.0.0.1:9200/_cluster/health'

    # [Sat Feb 12 18:20:42 2011] Response:
    # {
    #    "number_of_data_nodes" : 1,
    #    "relocating_shards" : 0,
    #    "active_shards" : 25,
    #    "status" : "yellow",
    #    "cluster_name" : "MyCluster",
    #    "active_primary_shards" : 25,
    #    "timed_out" : false,
    #    "initializing_shards" : 0,
    #    "number_of_nodes" : 1,
    #    "unassigned_shards" : 25
    # }

Why should it be complete?

The example should be sufficient to recreate the problem on a new, clean ElasticSearch server.

Quite often, the problem is a result of you having already indexed data that differs from your current example. Just by starting from scratch, you may solve your own problem.

If you don't provide all of the information, then it may be difficult for others to figure out where the issue is.

Where do I put my curl recreation?

Please don't paste long lines of code in the mailing list - it is difficult to read, and people will be less likely to take the time to help.

You can create a gist on github: http://gist.github.com/gists

"Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository."

What other information is useful?

It is useful to know what version of ElasticSearch you are using.

Depending on the problem, it may also be useful to know:

  • the version of your JVM
  • your local configuration
  • your operating system
  • how many nodes and indices you have
  • what gateway you are using (eg local, fs, s3 etc)
 
Fork me on GitHub