|
@@ -68,13 +68,13 @@ public class DefaultElasticsearchHandler implements ElasticsearchHandler {
|
|
this.client = new ElasticsearchClient(transport);
|
|
this.client = new ElasticsearchClient(transport);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取文档索引名称
|
|
|
|
- *
|
|
|
|
- * @param model 文档模型
|
|
|
|
- * @return 索引名称
|
|
|
|
- */
|
|
|
|
- private String getIndex(Class<?> model) {
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public ElasticsearchClient getClient() {
|
|
|
|
+ return this.client;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getIndex(@NonNull Class<?> model) {
|
|
String name = this.indexes.get(model);
|
|
String name = this.indexes.get(model);
|
|
return name != null ? name : this.indexes.computeIfAbsent(model, k -> {
|
|
return name != null ? name : this.indexes.computeIfAbsent(model, k -> {
|
|
Index index = model.getAnnotation(Index.class);
|
|
Index index = model.getAnnotation(Index.class);
|
|
@@ -83,11 +83,6 @@ public class DefaultElasticsearchHandler implements ElasticsearchHandler {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public ElasticsearchClient getClient() {
|
|
|
|
- return this.client;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public CreateResponse create(@NonNull Document<?> document) {
|
|
public CreateResponse create(@NonNull Document<?> document) {
|
|
String index = this.getIndex(document.getClass());
|
|
String index = this.getIndex(document.getClass());
|