Example usage for org.apache.solr.search ReRankQParserPlugin RERANK_WEIGHT

List of usage examples for org.apache.solr.search ReRankQParserPlugin RERANK_WEIGHT

Introduction

In this page you can find the example usage for org.apache.solr.search ReRankQParserPlugin RERANK_WEIGHT.

Prototype

String RERANK_WEIGHT

To view the source code for org.apache.solr.search ReRankQParserPlugin RERANK_WEIGHT.

Click Source Link

Usage

From source file:org.tallison.solr.search.QueryEqualityTest.java

License:Apache License

public void testReRankQuery() throws Exception {
    final String defType = ReRankQParserPlugin.NAME;
    SolrQueryRequest req = req("q", "*:*", "rqq", "{!edismax}hello", "rdocs", "20", "rweight", "2", "rows",
            "10", "start", "0");
    try {/*ww  w .  j  a  va  2s .  co m*/
        assertQueryEquals(defType, req,
                "{!" + defType + " " + ReRankQParserPlugin.RERANK_QUERY + "=$rqq "
                        + ReRankQParserPlugin.RERANK_DOCS + "=$rdocs " + ReRankQParserPlugin.RERANK_WEIGHT
                        + "=$rweight}",
                "{!" + defType + " " + ReRankQParserPlugin.RERANK_QUERY + "=$rqq "
                        + ReRankQParserPlugin.RERANK_DOCS + "=20 " + ReRankQParserPlugin.RERANK_WEIGHT + "=2}");

    } finally {
        req.close();
    }

    req = req("qq", "*:*", "rqq", "{!edismax}hello", "rdocs", "20", "rweight", "2", "rows", "100", "start",
            "50");
    try {
        assertQueryEquals(defType, req,
                "{!" + defType + " mainQuery=$qq " + ReRankQParserPlugin.RERANK_QUERY + "=$rqq "
                        + ReRankQParserPlugin.RERANK_DOCS + "=$rdocs " + ReRankQParserPlugin.RERANK_WEIGHT
                        + "=$rweight}",
                "{!" + defType + " mainQuery=$qq " + ReRankQParserPlugin.RERANK_QUERY + "=$rqq "
                        + ReRankQParserPlugin.RERANK_DOCS + "=20 " + ReRankQParserPlugin.RERANK_WEIGHT + "=2}");

    } finally {
        req.close();
    }
}