Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevcodez/elasticsearch-java-transportclient-showcase
Sample code for Elasticsearch Java API
https://github.com/kevcodez/elasticsearch-java-transportclient-showcase
elasticsearch elasticsearch-api java
Last synced: 8 days ago
JSON representation
Sample code for Elasticsearch Java API
- Host: GitHub
- URL: https://github.com/kevcodez/elasticsearch-java-transportclient-showcase
- Owner: kevcodez
- Created: 2016-12-09T21:25:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-09T21:38:45.000Z (about 8 years ago)
- Last Synced: 2024-11-08T18:12:41.677Z (2 months ago)
- Topics: elasticsearch, elasticsearch-api, java
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elasticsearch Java API
This repository contains code showing how to use the Elasticsearch API for Java.
## Setup
Download Elasticsearch from the official website
https://www.elastic.co/de/downloads/elasticsearchUnzip the folder and navigate into bin.
Execute the elasticsearch.bat / elasticsearch.sh.
Run the de.kevcodez.elasticsearch.create.FillIndex class that generates a few thousand of orders and puts them into Elasticsearch.
You may now run de.kevcodez.elasticsearch.search.Aggregations or de.kevcodez.elasticsearch.search.BasicSearch.
### Create ElasticSearch Index
You need to create an index named orders.
`curl -X PUT localhost:9200/orders`
### Edit Host/Port
The de.kevcodez.elasticsearch.Client creates an Elasticsearch client with the default Port 9300 and host localhost.
### Lombok
This project uses Lombok, see http://projectlombok.org for reference.
## Further reading
Java API Overview: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html