index.asciidoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. [[java-api]]
  2. = Java API
  3. :ref: http://www.elastic.co/guide/en/elasticsearch/reference/master
  4. [preface]
  5. == Preface
  6. This section describes the Java API that elasticsearch provides. All
  7. elasticsearch operations are executed using a
  8. <<client,Client>> object. All
  9. operations are completely asynchronous in nature (either accepts a
  10. listener, or returns a future).
  11. Additionally, operations on a client may be accumulated and executed in
  12. <<java-docs-bulk,Bulk>>.
  13. Note, all the APIs are exposed through the
  14. Java API (actually, the Java API is used internally to execute them).
  15. == Maven Repository
  16. Elasticsearch is hosted on
  17. http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22elasticsearch%22[Maven
  18. Central].
  19. For example, you can define the latest version in your `pom.xml` file:
  20. [source,xml]
  21. --------------------------------------------------
  22. <dependency>
  23. <groupId>org.elasticsearch</groupId>
  24. <artifactId>elasticsearch</artifactId>
  25. <version>${es.version}</version>
  26. </dependency>
  27. --------------------------------------------------
  28. == Deploying in JBoss EAP6 module
  29. Elasticsearch and Lucene classes need to be in the same JBoss module.
  30. You should define a `module.xml` file like this:
  31. [source,xml]
  32. --------------------------------------------------
  33. <?xml version="1.0" encoding="UTF-8"?>
  34. <module xmlns="urn:jboss:module:1.1" name="org.elasticsearch">
  35. <resources>
  36. <!-- Elasticsearch -->
  37. <resource-root path="elasticsearch-2.0.0.jar"/>
  38. <!-- Lucene -->
  39. <resource-root path="lucene-core-5.1.0.jar"/>
  40. <resource-root path="lucene-analyzers-common-5.1.0.jar"/>
  41. <resource-root path="lucene-queries-5.1.0.jar"/>
  42. <resource-root path="lucene-memory-5.1.0.jar"/>
  43. <resource-root path="lucene-highlighter-5.1.0.jar"/>
  44. <resource-root path="lucene-queryparser-5.1.0.jar"/>
  45. <resource-root path="lucene-sandbox-5.1.0.jar"/>
  46. <resource-root path="lucene-suggest-5.1.0.jar"/>
  47. <resource-root path="lucene-misc-5.1.0.jar"/>
  48. <resource-root path="lucene-join-5.1.0.jar"/>
  49. <resource-root path="lucene-grouping-5.1.0.jar"/>
  50. <resource-root path="lucene-spatial-5.1.0.jar"/>
  51. <resource-root path="lucene-expressions-5.1.0.jar"/>
  52. <!-- Insert other resources here -->
  53. </resources>
  54. <dependencies>
  55. <module name="sun.jdk" export="true" >
  56. <imports>
  57. <include path="sun/misc/Unsafe" />
  58. </imports>
  59. </module>
  60. <module name="org.apache.log4j"/>
  61. <module name="org.apache.commons.logging"/>
  62. <module name="javax.api"/>
  63. </dependencies>
  64. </module>
  65. --------------------------------------------------
  66. include::client.asciidoc[]
  67. include::docs.asciidoc[]
  68. include::search.asciidoc[]
  69. include::count.asciidoc[]
  70. include::aggs.asciidoc[]
  71. include::percolate.asciidoc[]
  72. include::query-dsl.asciidoc[]
  73. include::indexed-scripts.asciidoc[]