Skip to content

Commit

Permalink
Fix query gen for elasitcboost weights of 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Holden Karau authored and adamalix committed May 10, 2012
1 parent c9dd050 commit 5e9d133
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
@@ -1,6 +1,6 @@
name := "slashem"

version := "0.9.14"
version := "0.9.15"

organization := "com.foursquare"

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/foursquare/slashem/Ast.scala
Expand Up @@ -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 + ")")
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
Expand Up @@ -78,6 +78,14 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
val r = fullQuery fetch()
}

@Test
def simpleBoostTest {
val fullQuery = ESimplePanda.where(_.name contains "lol")
.limit(5).boostField(_.followers)
val r = fullQuery fetch()
}


@Test
def testEmptySearch {
try {
Expand Down

0 comments on commit 5e9d133

Please sign in to comment.