Examples of Distance


Examples of org.springframework.data.geo.Distance

    solrTemplate.saveBeans(Arrays.asList(searchableBeanInBuffalow, searchableBeanInNYC));
    solrTemplate.commit();

    Page<ExampleSolrBean> result = solrTemplate.queryForPage(
        new SimpleQuery(new Criteria("store").near(new Point(45.15, -93.85), new Distance(3.106856, Metrics.MILES))),
        ExampleSolrBean.class);

    Assert.assertEquals(1, result.getContent().size());
  }
View Full Code Here

Examples of org.springframework.data.geo.Distance

    Assert.assertThat(parser.createFunctionFragment(function, 0), Is.is("{!func}foo(37.767624,-122.48526)"));
  }

  @Test
  public void testCreateFunctionFragmentConvertsDistanceProperty() {
    Foo function = new Foo(Arrays.asList(new Distance(5, Metrics.KILOMETERS)));

    Assert.assertThat(parser.createFunctionFragment(function, 0), Is.is("{!func}foo(5.0)"));
  }
View Full Code Here

Examples of org.springframework.data.mongodb.core.geo.Distance

     repo.save( new Location("D�sseldorf", 6.810036, 51.224088 ) );    
   }

  @Test public void shouldFindSelf() {
    // when
    List<Location> locations = repo.findByPositionNear(DUS , new Distance(1, Metrics.KILOMETERS) );

    // then
    assertLocations(locations, "D�sseldorf");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.