Examples of TermQueryPrefixTreeStrategy


Examples of org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy

    grid = new QuadPrefixTree(ctx,25);
    strategy = new RecursivePrefixTreeStrategy(grid, "recursive_quad");
    ctorArgs.add(new Object[]{new Param(strategy)});

    grid = new GeohashPrefixTree(ctx,12);
    strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
    ctorArgs.add(new Object[]{new Param(strategy)});

    strategy = new PointVectorStrategy(ctx, "pointvector");
    ctorArgs.add(new Object[]{new Param(strategy)});
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy

    final SpatialPrefixTree gridQuad = new QuadPrefixTree(ctx,10);
    final SpatialPrefixTree gridGeohash = new GeohashPrefixTree(ctx,10);

    Collection<SpatialStrategy> strategies = new ArrayList<>();
    strategies.add(new RecursivePrefixTreeStrategy(gridGeohash, "recursive_geohash"));
    strategies.add(new TermQueryPrefixTreeStrategy(gridQuad, "termquery_quad"));
    strategies.add(new PointVectorStrategy(ctx, "pointvector"));
    //strategies.add(new BBoxStrategy(ctx, "bbox"));
    strategies.add(new SerializedDVStrategy(ctx, "serialized"));
    for (SpatialStrategy strategy : strategies) {
      testEqualsHashcode(strategy);
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy

   */
  @Test
  public void testBadPrefixTreePrune() throws Exception {

    trie = new QuadPrefixTree(ctx, 12);
    TermQueryPrefixTreeStrategy strategy = new TermQueryPrefixTreeStrategy(trie, "geo");
    Document doc = new Document();
    doc.add(new TextField("id", "1", Store.YES));

    Shape area = ctx.makeRectangle(-122.82, -122.78, 48.54, 48.56);

    Field[] fields = strategy.createIndexableFields(area, 0.025);
    for (Field field : fields) {
      doc.add(field);
    }
    addDocument(doc);

    Point upperleft = ctx.makePoint(-122.88, 48.54);
    Point lowerright = ctx.makePoint(-122.82, 48.62);

    Query query = strategy.makeQuery(new SpatialArgs(SpatialOperation.Intersects, ctx.makeRectangle(upperleft, lowerright)));

    commit();

    TopDocs search = indexSearcher.search(query, 10);
    ScoreDoc[] scoreDocs = search.scoreDocs;
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy

                               FieldType fieldType, PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
                               MultiFields multiFields, CopyTo copyTo) {
        super(names, 1, fieldType, null, null, null, postingsProvider, docValuesProvider, null, null, null, null, multiFields, copyTo);
        this.recursiveStrategy = new RecursivePrefixTreeStrategy(tree, names.indexName());
        this.recursiveStrategy.setDistErrPct(distanceErrorPct);
        this.termStrategy = new TermQueryPrefixTreeStrategy(tree, names.indexName());
        this.termStrategy.setDistErrPct(distanceErrorPct);
        this.defaultStrategy = resolveStrategy(defaultStrategyName);
    }
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.