Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tests for Term filter queries.

  • Loading branch information...
commit 77e3ab98c17a76aa2d917fdae4e1cef92bbb10d7 1 parent 47cb673
Adam Alix adamalix authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
24 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
View
@@ -347,18 +347,18 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
- def testUnanalyzed {
- try {
- val res1 = ESimplePanda where (_.termsfield eqs "termhit") fetch()
- val res2 = ESimplePanda where (_.termsfield in List("randomterm", "termhit")) fetch()
- Assert.assertEquals(res1.response.results.length, 1)
- Assert.assertEquals(res2.response.results.length, 1)
- } catch {
- case e: Exception => {
- e.printStackTrace()
- Assert.fail
- }
- }
+ def testTermQueries {
+ val res1 = ESimplePanda where (_.termsfield eqs "termhit") fetch()
+ val res2 = ESimplePanda where (_.termsfield in List("randomterm", "termhit")) fetch()
+ Assert.assertEquals(res1.response.results.length, 1)
+ Assert.assertEquals(res2.response.results.length, 1)
+ }
+
+ @Test
+ def testTermFilters {
+ // grab 2 results, filter to 1
+ val res1 = ESimplePanda where (_.hugenums contains 1L) filter(_.termsfield in List("termhit", "randomterm")) fetch()
+ Assert.assertEquals(res1.response.results.length, 1)
}
@Before
Please sign in to comment.
Something went wrong with that request. Please try again.