Play Framework 2 ElasticSearch存储类型

时间:2013-02-01 11:21:39

标签: playframework playframework-2.0 elasticsearch

我决定在Play Framework项目中使用ElasticSearch(Play 2.0.3)。

我发现并开始使用play2-elasticsearch插件(感谢autors,这是非常有用的工具),它以本地模式启动ElasticSearch服务器并将其用作搜索服务器。

现在我想为ElasticSearch服务器设置一些其他配置选项。例如。将存储类型设置为内存中。 ElasticSearch documentstion describes如何在独立模式下调整配置设置。

但是如何使用播放插件执行这些操作?

2 个答案:

答案 0 :(得分:2)

实际上无法自定义“node”(issue9)上的设置,但您可以通过application.conf中的“elasticsearch.index.settings”属性定义“index”的设置

## Custom settings to apply when creating the index (optional)
elasticsearch.index.settings="{ analysis: { analyzer: { my_analyzer: { type: \"custom\", tokenizer: \"standard\" } } } }"

对于设置商店类型,您可以设置如下设置:

elasticsearch.index.settings="{ store : { type: \"memory\" } }"

答案 1 :(得分:1)

我是play2-elasticsearch插件的作者之一。 我只是在我们的github存储库上创建了一个问题,用于添加此配置设置。

如果您要在我们发布新版本之前修改并在本地发布模块,它就位于此类https://github.com/cleverage/play2-elasticsearch/blob/master/module/app/com/github/cleverage/elasticsearch/IndexClient.java上。

@nboire