Пример #1
0
  /** test range query performance */
  public void XtestFilteringPerformance() throws Exception {
    int indexSize = 19999;
    float fractionCovered = .1f;

    String l = t(0);
    String u = t((int) (indexSize * 10 * fractionCovered));

    SolrQueryRequest req = lrf.makeRequest();

    QParser parser = QParser.getParser("foomany_s:[" + l + " TO " + u + "]", null, req);
    Query rangeQ = parser.parse();
    List<Query> filters = new ArrayList<Query>();
    filters.add(rangeQ);
    req.close();

    parser =
        QParser.getParser(
            "{!dismax qf=t10_100_ws pf=t10_100_ws ps=20}" + t(0) + ' ' + t(1) + ' ' + t(2),
            null,
            req);
    Query q = parser.parse();

    // SolrIndexSearcher searcher = req.getSearcher();
    // DocSet range = searcher.getDocSet(rangeQ, null);

    createIndex2(indexSize, "foomany_s", "t10_100_ws");

    // doListGen(100, q, filters, false, true);
    doListGen(500, q, filters, false, true);

    req.close();
  }
Пример #2
0
  /** test range query performance */
  public void XtestRangePerformance() throws Exception {
    int indexSize = 1999;
    float fractionCovered = 1.0f;

    String l = t(0);
    String u = t((int) (indexSize * 10 * fractionCovered));

    SolrQueryRequest req = lrf.makeRequest();
    QParser parser = QParser.getParser("foomany_s:[" + l + " TO " + u + "]", null, req);
    Query range = parser.parse();

    QParser parser2 = QParser.getParser("{!frange l=" + l + " u=" + u + "}foomany_s", null, req);
    Query frange = parser2.parse();
    req.close();

    createIndex2(indexSize, "foomany_s");

    doSetGen(1, range);
    doSetGen(1, frange); // load field cache

    doSetGen(100, range);
    doSetGen(10000, frange);
  }
    public Query parse() throws SyntaxError {
      String reRankQueryString = localParams.get("reRankQuery");
      boolean scale = localParams.getBool("scale", false);
      QParser reRankParser = QParser.getParser(reRankQueryString, null, req);
      Query reRankQuery = reRankParser.parse();

      int reRankDocs = localParams.getInt("reRankDocs", 200);
      reRankDocs = Math.max(1, reRankDocs); //

      double reRankWeight = localParams.getDouble("reRankWeight", 2.0d);

      int start = params.getInt(CommonParams.START, 0);
      int rows = params.getInt(CommonParams.ROWS, 10);
      int length = start + rows;
      return new ReRankQuery(reRankQuery, reRankDocs, reRankWeight, length, scale);
    }