3

Elastic4s APIを使用して、一部のデータをエラスティック検索にインデックス付けしようとしてい ます

しかし、コンパイルエラーが発生します not found: value index

これはコードです。後で、js オブジェクト フィールドをエラスティック検索フィールドにマップします が、今のところ、テスト ケースにインデックスを付けたいだけです。

import com.sksamuel.elastic4s._
def indexComment(commentList: List[JsObject]) {
val client = ElasticClient.local
for (comment <- commentList) {
   val id = comment.\("id").as[String]   
   client.execute {
     index into "posts/test" id id.toString() fields (
      "name" -> "London",
      "country" -> "United Kingdom",
      "continent" -> "Europe",
      "status" -> "Awesome")
    }

   }

   }

  }

これがSBTファイルです

libraryDependencies ++= Seq( jdbc, anorm, cache, "org.webjars" %% "webjars-play" % "2.2.1", "org.webjars" % "bootstrap" % "3.1.0", "org.webjars" % "jquery" % "2.1.0-1", "com.sksamuel.elastic4s" %% "elastic4s" % "1.0.0.0"
)

これは完全なエラーです

[error] /home/mik/programing/posts/app/helper/Helper.scala:27: not found: value index [error] index into "posts/test" id id.toString() fields ( [error] ^ [error] one error found [error] (compile:compile) Compilation failed [error] Total time: 2 s, completed Feb 15, 2014 1:34:54 PM

インストールプロセスで何かを見逃しましたか??

それとも何か他のものですか??

ありがとうミキ

4

1 に答える 1