Skip to content
Browse files

Add a test for ES filter queries

  • Loading branch information...
1 parent 8916007 commit 031a2ab0f86d920eb30b5a24f6f7aa668c50759e @holdenk holdenk committed May 31, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
View
11 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
@@ -406,17 +406,18 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
Assert.assertEquals(res1.response.results.length, 1)
}
+ def testCustomScoreScripts {
+ val params: Map[String, Any] = Map("lat" -> -31.1, "lon" -> 74.0, "weight" -> 2000, "weight2" -> 0.03)
+ val response1 = ESimpleGeoPanda where(_.name contains "lolerskates") customScore("distance_score_magic", params) fetch()
+ Assert.assertEquals(response1.response.results.length, 2)
+ }
+
def testFilters {
// grab 2 results, filter to 1
val res1 = ESimplePanda where (_.hugenums contains 1L) filter(_.nicknamesString in List("jerry")) fetch()
Assert.assertEquals(res1.response.results.length, 1)
}
- def testCustomScoreScripts {
- val params: Map[String, Any] = Map("lat" -> -31.1, "lon" -> 74.0, "weight" -> 2000, "weight2" -> 0.03)
- val response1 = ESimpleGeoPanda where(_.name contains "lolerskates") customScore("distance_score_magic", params) fetch()
- Assert.assertEquals(response1.response.results.length, 2)
- }
@Before
def hoboPrepIndex() {

0 comments on commit 031a2ab

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