Java Code Examples for org.apache.lucene.search.Query#equals()
The following examples show how to use
org.apache.lucene.search.Query#equals() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 6 votes |
@Test public void test28() throws ParseException { SpatialContext ctx = SpatialContext.GEO; ShapeReadWriter<SpatialContext> shapeReadWriter = new ShapeReadWriter<SpatialContext>(ctx); int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_KM)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); String writeSpatialArgs = SpatialArgsParser.writeSpatialArgs(args, shapeReadWriter); // This has to be done because of rounding. SpatialArgs spatialArgs = SpatialArgsParser.parse(writeSpatialArgs, shapeReadWriter); Query q1 = sq(strategy.makeQuery(spatialArgs)); Query q = parseSq("a.id_gis:\"" + writeSpatialArgs + "\""); boolean equals = q1.equals(q); assertTrue(equals); }
Example 2
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Test public void test29() throws ParseException { SpatialContext ctx = SpatialContext.GEO; int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_KM)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); Query q1 = sq(strategy.makeQuery(args)); Query q = parseSq("a.id_gis:\"Intersects(Circle(33.000000,-80.000000 d=10.0km))\""); boolean equals = q1.equals(q); assertTrue(equals); }
Example 3
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Test public void test30() throws ParseException { SpatialContext ctx = SpatialContext.GEO; int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_MI)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); Query q1 = sq(strategy.makeQuery(args)); Query q = parseSq("a.id_gis:\"Intersects(Circle(33.000000,-80.000000 d=10.0m))\""); boolean equals = q1.equals(q); assertTrue(equals); }
Example 4
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Test public void test45() throws ParseException { SpatialContext ctx = SpatialContext.GEO; int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_MI)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); Query q1 = sq(bq(bc_m(strategy.makeQuery(args)))); Query q = parseSq("<+a.id_gis:\"Intersects(Circle(33.000000,-80.000000 d=10.0m))\">"); boolean equals = q1.equals(q); assertTrue(equals); }
Example 5
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Test public void test46() throws ParseException { SpatialContext ctx = SpatialContext.GEO; int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_MI)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); Query q1 = sq(bq(bc_m(strategy.makeQuery(args)), bc(tq("rowid", "12345")))); Query q = parseSq("<+a.id_gis:\"Intersects(Circle(33.000000,-80.000000 d=10.0m))\" rowid:12345>"); boolean equals = q1.equals(q); assertTrue(equals); }
Example 6
Source File: SuperParserTest.java From incubator-retired-blur with Apache License 2.0 | 5 votes |
@Test public void test47() throws ParseException { SpatialContext ctx = SpatialContext.GEO; int maxLevels = 11; SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels); RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis", false); Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_MI)); SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle); Query q1 = sq(strategy.makeQuery(args)); Query q = parseSq("<a.id_gis:\"Intersects(Circle(33.000000,-80.000000 d=10.0m))\">"); boolean equals = q1.equals(q); assertTrue(equals); }