Permalink
Browse files

Fix index on geo docs used for testing

  • Loading branch information...
1 parent 6551684 commit f862257cb7b068f06b4534f00f58d1d77b58aaf2 @holdenk committed Jul 30, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −0 build.sbt
  2. +7 −7 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
View
1 build.sbt
@@ -55,6 +55,7 @@ resolvers += "codehaus maven repo" at "http://repository.codehaus.org/"
resolvers += "sonatype maven repo" at "http://oss.sonatype.org/content/repositories/releases/"
+
resolvers <++= (version) { v =>
if (v.endsWith("-SNAPSHOT"))
Seq(ScalaToolsSnapshots)
View
14 src/test/scala/com/foursquare/slashem/ElasticQueryTest.scala
@@ -261,7 +261,7 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
def geoOrderDesc {
- var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderDesc(_.point sqeGeoDistance(74.0,-31.0)) fetch()
+ var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderDesc(_.point sqeGeoDistance(40,-74)) fetch()
Assert.assertEquals(2,r.response.results.length)
val doc0 = r.response.oidScorePair.apply(0)
val doc1= r.response.oidScorePair.apply(1)
@@ -270,7 +270,7 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
def geoOrderDescWithBoost {
- var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderDesc(_.point sqeGeoDistance(74.0,-31.0)) boostField(_.decayedPopularity1,0.001) fetch()
+ var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderDesc(_.point sqeGeoDistance(40,-74)) boostField(_.decayedPopularity1,0.001) fetch()
Assert.assertEquals(2,r.response.results.length)
val doc0 = r.response.oidScorePair.apply(0)
val doc1= r.response.oidScorePair.apply(1)
@@ -279,7 +279,7 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
def geoOrderAsc {
- var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(74.0,-31.0)) fetch()
+ var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(40,-74)) fetch()
Assert.assertEquals(2,r.response.results.length)
val doc0 = r.response.oidScorePair.apply(0)
val doc1= r.response.oidScorePair.apply(1)
@@ -288,7 +288,7 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
def geoOrderAscWithBoostField {
- var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(74.0,-31.0)) boostField(_.decayedPopularity1,0.001) fetch()
+ var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(40,-74)) boostField(_.decayedPopularity1,0.001) fetch()
Assert.assertEquals(2,r.response.results.length)
val doc0 = r.response.oidScorePair.apply(0)
val doc1= r.response.oidScorePair.apply(1)
@@ -297,7 +297,7 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
}
@Test
def geoOrderIntAsc {
- var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(74,-31)) fetch()
+ var r = ESimpleGeoPanda where (_.name contains "ordertest") complexOrderAsc(_.point sqeGeoDistance(40,-74)) fetch()
Assert.assertEquals(2,r.response.results.length)
val doc0 = r.response.oidScorePair.apply(0)
val doc1= r.response.oidScorePair.apply(1)
@@ -709,15 +709,15 @@ class ElasticQueryTest extends SpecsMatchers with ScalaCheckMatchers {
.startObject()
.field("name","ordertest")
.field("id","4c809f4251ada1cdc3790b16")
- .field("point",74.0,-32.0)
+ .field("point",-122.403439,37.787355)
.endObject()
).execute()
.actionGet();
val geoOrderdoc2 = geoClient.prepareIndex(ESimpleGeoPanda.meta.indexName,ESimpleGeoPanda.meta.docType,"4c809f4251ada1cdc3790b17").setSource(jsonBuilder()
.startObject()
.field("name","ordertest")
.field("id","4c809f4251ada1cdc3790b17")
- .field("point",74.0,-31.0)
+ .field("point",-73.99039768,40.73709857)
.endObject()
).execute()
.actionGet();

0 comments on commit f862257

Please sign in to comment.