Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix query gen for elasitcboost weights of 1.0

  • Loading branch information...
commit 5e9d1331508cabd7146fd6a1e7ffd4971a3e836f 1 parent c9dd050
Holden Karau holdenk authored adamalix committed
2  build.sbt
View
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.9.14"
+version := "0.9.15"
organization := "com.foursquare"
2  src/main/scala/com/foursquare/slashem/Ast.scala
View
@@ -243,7 +243,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 + ")")
}
}
8 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
View
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.