use of org.springframework.data.geo.Distance in project nixmash-blog by mintster.
the class SolrLocationTests method testFindByLocationCriteria.
@Test
public void testFindByLocationCriteria() {
Point location = new Point(22.15, -90.85);
Criteria criteria = new Criteria("store").near(location, new Distance(5));
Page<Product> result = solrOperations.queryForPage(new SimpleQuery(criteria), Product.class);
Assert.assertEquals(1, result.getTotalElements());
Assert.assertEquals(locatedInYonkers.getId(), result.getContent().get(0).getId());
}
use of org.springframework.data.geo.Distance in project nixmash-blog by mintster.
the class SolrLocationTests method testFindByNear.
@Test
public void testFindByNear() {
List<Product> found = repo.findByLocationNear(new Point(22.15, -90.85), new Distance(5));
locationAsserts(found);
}
use of org.springframework.data.geo.Distance in project nixmash-blog by mintster.
the class SolrLocationTests method testFindByLocationWithin.
@Test
public void testFindByLocationWithin() {
List<Product> found = repo.findByLocationWithin(new Point(22.15, -90.85), new Distance(5));
locationAsserts(found);
}
use of org.springframework.data.geo.Distance in project nixmash-blog by mintster.
the class SolrLocationTests method testFindByAnnotatedQueryNear.
@Test
public void testFindByAnnotatedQueryNear() {
List<Product> found = repo.findByLocationSomewhereNear(new Point(22.15, -90.85), new Distance(5));
locationAsserts(found);
}
Aggregations