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

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

Introduction

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

Prototype

String NAME

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

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 {/*from   w w w  .  ja  va  2 s .  c  o  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();
    }
}