Examples of LuceneProxyNodeQuery


Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

    if (child instanceof BooleanQueryNode) {
      // no need to wrap the query object into a lucene proxy query
      return (Query) obj;
    }
    else {
      return new LuceneProxyNodeQuery((NodeQuery) obj);
    }
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

      query.setBoost(this.getBoost());
    }

    // should we wrap the query into a lucene proxy
    if (proxy) {
      return new LuceneProxyNodeQuery(query);
    }
    return query;
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

      query.setBoost(this.getBoost());
    }

    // should we wrap the query into a lucene proxy
    if (proxy) {
      return new LuceneProxyNodeQuery(query);
    }
    return query;
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

    config.put(KeywordConfigurationKeys.DATATYPES_ANALYZERS, dts);

    final NodeNumericRangeQuery q = NodeNumericRangeQuery.newLongRange(SirenTestCase.DEFAULT_TEST_FIELD,
      4, 50l, 60l, true, false);
    q.setDatatype(XSDDatatype.XSD_LONG);
    this._assertSirenQuery(config, new LuceneProxyNodeQuery(q), "xsd:long([50 TO 60})");
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  @Test
  public void testFuzzyQuery2()
  throws Exception {
    final NodeQuery q1 = new NodeFuzzyQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "michel"));
    this._assertSirenQuery(new LuceneProxyNodeQuery(q1), "michel~");

    final TwigQuery q2 = new TwigQuery(1);
    q2.addChild(q1, NodeBooleanClause.Occur.MUST);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q2), "* : michel~");

    final int numEdits = FuzzyQuery.floatToEdits(0.8f, "michel".codePointCount(0, "michel".length()));
    final NodeQuery q3 = new NodeFuzzyQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "michel"), numEdits);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q3), "michel~0.8");

    // first tilde is escaped, not the second one
    final NodeQuery q4 = new NodeFuzzyQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "http://sw.deri.org/~aida"));
    this._assertSirenQuery(new LuceneProxyNodeQuery(q4), "'http://sw.deri.org/~aida'~");
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  @Test
  public void testWildcardQuery2()
  throws Exception {
    final NodeQuery q1 = new NodeWildcardQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "st*e.ca?as"));
    this._assertSirenQuery(new LuceneProxyNodeQuery(q1), "st*e.ca?as");
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  throws Exception {
    final BooleanQuery q = new BooleanQuery();
    q.add(ntq("c").getLuceneProxyQuery(), BooleanClause.Occur.MUST);
    final NodeQuery nq = ntq("b").getNodeQuery();
    nq.setBoost(2);
    q.add(new LuceneProxyNodeQuery(nq), BooleanClause.Occur.MUST);
    this._assertSirenQuery(q, "c b^2");
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  }

  @Test
  public void testPrefixQuery()
  throws Exception {
    final Query ntq = new LuceneProxyNodeQuery(
      new NodePrefixQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "lit"))
    );
    this._assertSirenQuery(ntq, "lit*");

    final TwigQuery twq = new TwigQuery(1);
    twq.addChild(new NodePrefixQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "lit")),
      NodeBooleanClause.Occur.MUST);
    this._assertSirenQuery(new LuceneProxyNodeQuery(twq), "* : lit*");
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  @Test
  public void testRangeQueries()
  throws Exception {
    NodeQuery q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
      new BytesRef("a"), new BytesRef("b"), true, true);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q), "[ a TO b ]");

    q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
      new BytesRef("a"), new BytesRef("b"), false, true);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q), "{ a TO b ]");

    q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
      new BytesRef("a"), new BytesRef("b"), true, false);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q), "[ a TO b }");

    q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
      new BytesRef("a"), new BytesRef("b"), false, false);
    this._assertSirenQuery(new LuceneProxyNodeQuery(q), "{ a TO b }");

    final TwigQuery twq1 = new TwigQuery(1);
    twq1.addChild(q, NodeBooleanClause.Occur.MUST);
    // TODO parsing the output of #toString of twq1 is not possible because of GH-52
    assertEquals(new LuceneProxyNodeQuery(twq1), this.parse(null, "* : { a TO b }"));

    final TwigQuery twq2 = new TwigQuery(1);
    twq2.addChild(new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
      new BytesRef("a"), new BytesRef("b"), true, true), NodeBooleanClause.Occur.MUST);
    twq2.addChild(q, NodeBooleanClause.Occur.MUST);
    assertEquals(new LuceneProxyNodeQuery(twq2), this.parse(null, "* : [ [ a TO b ], { a TO b } ]"));
  }
View Full Code Here

Examples of org.sindice.siren.search.node.LuceneProxyNodeQuery

  }

  @Test
  public void testRegexQueries()
  throws Exception {
    final Query reg = new LuceneProxyNodeQuery(
      new NodeRegexpQuery(new Term(SirenTestCase.DEFAULT_TEST_FIELD, "s*e"))
    );
    this._assertSirenQuery(reg, "/s*e/");
  }
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.