Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix range query issue.

  • Loading branch information...
commit e8b3432cc362fb9429ebc9d9d86a6c00faa56941 1 parent a8ecacc
@holdenk holdenk authored
View
2  src/main/scala/com/foursquare/slashem/Ast.scala
@@ -93,7 +93,7 @@ object Ast {
}
case class Range[T](q1: T,q2: T) extends Query[T] {
- def extend = {'['+escape(q1.toString)+" to "+ escape(q2.toString) +']'}
+ def extend = {'['+escape(q1.toString)+" TO "+ escape(q2.toString) +']'}
}
case class UnescapedPhrase[T](query: T) extends Query[T] {
View
4 src/test/scala/com/foursquare/slashem/QueryTest.scala
@@ -166,7 +166,7 @@ class QueryTest extends SpecsMatchers with ScalaCheckMatchers {
val q = SVenueTest where (_.default inRange("a","z")) useQueryType("edismax")
val qp = q.queryParams().toList
Assert.assertEquals(qp.sortWith(_._1 > _._1),List("defType" -> "edismax",
- "q" -> "([a to z])",
+ "q" -> "([a TO z])",
"start" -> "0",
"rows" -> "10").sortWith(_._1 > _._1))
}
@@ -187,7 +187,7 @@ class QueryTest extends SpecsMatchers with ScalaCheckMatchers {
val d2 = new DateTime(2011, 5, 2, 0, 0, 0, 0, DateTimeZone.UTC)
val q = SEventTest where (_.start_time inRange(d1, d2))
val qp = q.queryParams().toList
- Assert.assertEquals(qp.sortWith(_._1 > _._1),List("q" -> "start_time:([2011\\-05\\-01T00\\:00\\:00.000Z to 2011\\-05\\-02T00\\:00\\:00.000Z])",
+ Assert.assertEquals(qp.sortWith(_._1 > _._1),List("q" -> "start_time:([2011\\-05\\-01T00\\:00\\:00.000Z TO 2011\\-05\\-02T00\\:00\\:00.000Z])",
"start" -> "0",
"rows" -> "10").sortWith(_._1 > _._1))
}
Please sign in to comment.
Something went wrong with that request. Please try again.