Skip to content
Browse files

Fix query gen for elasitcboost weights of 1.0

  • Loading branch information...
1 parent e47800c commit 6a048f48e7cf922328a7af2be8774fb47dfc95a5 @holdenk holdenk committed
View
2 build.sbt
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.9.14"
+version := "0.9.15"
organization := "com.foursquare"
View
2 src/main/scala/com/foursquare/slashem/Ast.scala
@@ -242,7 +242,7 @@ object Ast {
}
def elasticBoost(): Pair[List[String],String] = {
weight match {
- case 1.0 => Pair(Nil,"(doc['" + fieldName + "'].value)")
+ case 1.0 => Pair(Nil,"doc['" + fieldName + "'].value")
case _ => Pair(Nil,"(doc['" + fieldName + "'].value *" + weight.toString + ")")
}
}
View
8 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
@@ -79,6 +79,14 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
+ def simpleBoostTest {
+ val fullQuery = ESimplePanda.where(_.name contains "lol")
+ .limit(5).boostField(_.followers)
+ val r = fullQuery fetch()
+ }
+
+
+ @Test
def testEmptySearch {
try {
val r = ESimplePanda where (_.name eqs "lolsdonotinsertsomethingwiththisinit") fetch()

0 comments on commit 6a048f4

Please sign in to comment.
Something went wrong with that request. Please try again.