Examples of LuceneProxyNodeQuery


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

    // Test for custom datatypes
    final BooleanQuery bq1 = new BooleanQuery();
    final NodePrimitiveQuery range1 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 12, 21, true, true);
    range1.setDatatype("xsd:int");
    bq1.add(new LuceneProxyNodeQuery(range1), BooleanClause.Occur.MUST);
    final Query npq = npq("12", "oct", "2012").setDatatype("xsd:date")
                       .getLuceneProxyQuery();
    bq1.add(npq, BooleanClause.Occur.MUST);
    this._assertSirenQuery(config, bq1, "xsd:int([12 TO 21]) xsd:date(\"12 Oct 2012\")");
  }
View Full Code Here

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

    final BooleanQuery bq2 = new BooleanQuery();
    final NodePrimitiveQuery range1 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 12, 21, true, true);
    range1.setDatatype("xsd:int");
    bq2.add(new LuceneProxyNodeQuery(range1), BooleanClause.Occur.MUST);
    final NodePrimitiveQuery range2 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 12, 12, true, true);
    range2.setDatatype("xsd:int");
    bq2.add(new LuceneProxyNodeQuery(range2), BooleanClause.Occur.MUST);

    bq1.add(bq2, BooleanClause.Occur.MUST);
    final Query npq = npq("12", "oct", "2012").setDatatype("xsd:date")
    .getLuceneProxyQuery();
    bq1.add(npq, BooleanClause.Occur.MUST);
View Full Code Here

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

        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 1, 10, true, true);
    range1To10.setDatatype("xsd:int");
    final NodePrimitiveQuery range20To40 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 20, 40, true, true);
    range20To40.setDatatype("xsd:int");
    bq1.add(new LuceneProxyNodeQuery(range1To10), BooleanClause.Occur.SHOULD);
    bq1.add(new LuceneProxyNodeQuery(range20To40), BooleanClause.Occur.SHOULD);

    final BooleanQuery bq2 = new BooleanQuery();
    final NodePrimitiveQuery range10To15 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 10, 15, true, true);
    range10To15.setDatatype("xsd:int");
    final NodePrimitiveQuery range50To55 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 50, 55, true, true);
    range50To55.setDatatype("xsd:int");
    bq2.add(new LuceneProxyNodeQuery(range10To15), BooleanClause.Occur.SHOULD);
    bq2.add(new LuceneProxyNodeQuery(range50To55), BooleanClause.Occur.SHOULD);

    final BooleanQuery bq3 = new BooleanQuery();
    bq3.add(bq1, BooleanClause.Occur.MUST);
    bq3.add(bq2, BooleanClause.Occur.MUST);
    this._assertSirenQuery(config, bq3, "xsd:int([1 TO 10] OR [20 TO 40]) AND xsd:int([10 TO 15] OR [50 TO 55])");
View Full Code Here

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

    // Test for custom datatypes
    final BooleanQuery bq1 = new BooleanQuery();
    final NodePrimitiveQuery range1 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 1, 1, true, true);
    range1.setDatatype("xsd:int");
    bq1.add(new LuceneProxyNodeQuery(range1), BooleanClause.Occur.MUST);
    final NodePrimitiveQuery range2 = NodeNumericRangeQuery
      .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 2, 2, true, true);
    range2.setDatatype("xsd:int");
    bq1.add(new LuceneProxyNodeQuery(range2), BooleanClause.Occur.MUST_NOT);

    this._assertSirenQuery(config, bq1, "+xsd:int(1) -xsd:int(2)");
    this._assertSirenQuery(config, bq1, "xsd:int(+1 -2)");
  }
View Full Code Here

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

    final Map<String, Analyzer> datatypes = new HashMap<String, Analyzer>();
    datatypes.put("int", new IntNumericAnalyzer(4));
    parser.setDatatypeAnalyzers(datatypes);

    final NodeQuery rangeWrong = NodeNumericRangeQuery.newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 42, 12, 21, true, true);
    assertEquals(new LuceneProxyNodeQuery(rangeWrong), parser.parse("int([12 TO 21])", SirenTestCase.DEFAULT_TEST_FIELD));
  }
View Full Code Here

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

      openRight = NodeNumericRangeQuery
          .newDoubleRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 10d, null, true, true);
      openRight.setDatatype(datatype);
    }

    this._assertSirenQuery(config, new LuceneProxyNodeQuery(openLeft), datatype + "([* TO 10])");
    this._assertSirenQuery(config, new LuceneProxyNodeQuery(openRight), datatype + "([10 TO *])");
  }
View Full Code Here

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

    r1.setDatatype("int");
    final NodePrimitiveQuery r2 = NodeNumericRangeQuery
        .newIntRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 100, 500, true, true);
    r2.setDatatype("int");
    final BooleanQuery bq = new BooleanQuery();
    bq.add(new LuceneProxyNodeQuery(r1), BooleanClause.Occur.SHOULD);
    bq.add(new LuceneProxyNodeQuery(r2), BooleanClause.Occur.SHOULD);

    this._assertSirenQuery(config, bq, "int([50 TO 100] OR [100 TO 500])");
  }
View Full Code Here

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

    config.put(KeywordConfigurationKeys.DATATYPES_ANALYZERS, datatypes);

    final NodePrimitiveQuery q = NodeNumericRangeQuery
        .newFloatRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 50.5f, 1000.34f, true, true);
    q.setDatatype("float");
    this._assertSirenQuery(config, new LuceneProxyNodeQuery(q), "float([50.5 TO 1000.34])");
  }
View Full Code Here

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

    final BooleanClause[] clauses = new BooleanClause[queries.size()];

    for (int i = 0; i < clauses.length; i++) {
      Query q = queries.get(i);
      if (q instanceof NodeQuery) {
        q = new LuceneProxyNodeQuery((NodeQuery) q);
      }
      final BooleanClause.Occur occur;
      if (isMust) {
        occur = BooleanClause.Occur.MUST;
      } else if (isNot) {
View Full Code Here

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

import org.sindice.siren.util.BasicSirenTestCase;

public abstract class AbstractTestSirenScorer extends BasicSirenTestCase {

  public static LuceneProxyNodeQuery dq(final NodeQuery nq) {
    return new LuceneProxyNodeQuery(nq);
  }
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.