你好stackoverflowers!
我正在尝试将库 elastic4s 与 scala 一起使用,但是当我运行以下代码时(为了获取索引广告中的广告列表):
trait elastic4s {
def get: Future[SearchResponse] = {
val client = ElasticClient.local
client execute { search in "ads"->"ad" }
}
}
我得到了这个例外:
An error has occured: org.elasticsearch.indices.IndexMissingException: [ads] missing
Pastebin在这里有完整的输出。
这是我的配置:
-- Java
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
-- ElasticSearch
version 1.0.1
-- Elastic4s
version 2.10-1.0.1
Elastic Search 已在 localhost:9200 上启动并运行,并且存在此索引广告。这个 CURL 请求:
curl -XGET 'http://localhost:9200/ads/ad/_search'
返回
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "ads",
"_type": "ad",
"_id": "UrKm89AXTzOxB9kFdpue4Q",
"_score": 1,
"_source": {
"json": "json"
}
}
]
}
}
我无法理解...如果有人可以给我一个曲目:)