From 4189affa2a090a0ef8634a9da2ada3e991127e2f Mon Sep 17 00:00:00 2001 From: philippus Date: Mon, 15 Jul 2024 20:58:51 +0200 Subject: [PATCH] Avoid deprecated DenseVectorField apply method --- .../elastic4s/requests/mappings/DenseVectorFieldTest.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/mappings/DenseVectorFieldTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/mappings/DenseVectorFieldTest.scala index a6c1c5291c..916346576e 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/mappings/DenseVectorFieldTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/mappings/DenseVectorFieldTest.scala @@ -11,13 +11,13 @@ class DenseVectorFieldTest extends AnyFlatSpec with Matchers with ElasticApi { private val denseVectorIndexOptions = DenseVectorIndexOptions(Int8Hnsw, Some(10), Some(100), Some(1.0f)) "A DenseVectorField" should "support dims property" in { - val field = DenseVectorField(name = "myfield", dims = 3) + val field = DenseVectorField(name = "myfield").dims(3) DenseVectorFieldBuilderFn.build(field).string shouldBe """{"type":"dense_vector","dims":3,"index":false}""" } it should "support all similarity options" in { - val field = DenseVectorField(name = "myfield", dims = 3, index = true, similarity = L2Norm) + val field = DenseVectorField(name = "myfield").dims(3).index(true).similarity(L2Norm) DenseVectorFieldBuilderFn.build(field).string shouldBe """{"type":"dense_vector","dims":3,"index":true,"similarity":"l2_norm"}""" DenseVectorFieldBuilderFn.build(field.similarity(DotProduct)).string shouldBe @@ -29,7 +29,7 @@ class DenseVectorFieldTest extends AnyFlatSpec with Matchers with ElasticApi { } it should "support elementType property" in { - val field = DenseVectorField(name = "myfield", dims = 3).elementType("byte") + val field = DenseVectorField(name = "myfield").dims(3).elementType("byte") DenseVectorFieldBuilderFn.build(field).string shouldBe """{"type":"dense_vector","element_type":"byte","dims":3,"index":false}""" }