# tutorial-elasticsearch **Repository Path**: ma5d/tutorial-elasticsearch ## Basic Information - **Project Name**: tutorial-elasticsearch - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-19 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This project currently does not have a README file. The following README content has been generated based on the project structure and code map: --- # tutorial-elasticsearch This project is a Java-based Elasticsearch tutorial example that demonstrates how to perform basic operations such as index management, document insertion, update, and query using Elasticsearch. ## Project Structure - **ElasticsearchConfig.java**: Elasticsearch client configuration class that initializes the client using parameters from `application.properties`. - **User.java**: Data model class used to represent user information stored in Elasticsearch. - **ElasticsearchIndexTest.java**: Test class demonstrating the creation, search, and deletion operations of Elasticsearch indices. - **ElasticsearchDocumentTest.java**: Test class demonstrating document insertion, bulk insertion, update, and query operations. ## Quick Start ### Requirements - Java 8 or higher - Maven - Elasticsearch 7.x or higher ### Installation Steps 1. Clone the project: ```bash git clone https://gitee.com/ma5d/tutorial-elasticsearch.git ``` 2. Modify the configuration: Configure the Elasticsearch host address and port in `application.properties`: ```properties elasticsearch.host=localhost elasticsearch.port=9200 ``` 3. Build the project: ```bash mvn clean package ``` 4. Run tests: Execute methods in the test classes using an IDE or Maven, for example `ElasticsearchIndexTest` and `ElasticsearchDocumentTest`. ### Usage Examples - **Connection Test**: `ElasticsearchIndexTest.connectTest` - **Create Index**: `ElasticsearchIndexTest.indexCreateTest` - **Insert Document**: `ElasticsearchDocumentTest.documentInsertTest` - **Update Document**: `ElasticsearchDocumentTest.documentUpdateTest` - **Query Document**: `ElasticsearchDocumentTest.DocumentQueryTest.matchAll` ## Contribution Guide Pull Requests and Issues are welcome. Please follow the project's coding conventions and ensure that tests pass. ## License This project uses the MIT License. For details, please see the LICENSE file.