org.apache.solr.util

## Class TestHarness.LocalRequestFactory

- java.lang.Object
- - org.apache.solr.util.TestHarness.LocalRequestFactory

- Enclosing class:
    TestHarness

      public class TestHarness.LocalRequestFactory
      extends Object

  A Factory that generates LocalSolrQueryRequest objects using a specified set of default options.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Map<String,String>` | `args`
    `int` | `limit`
    `String` | `qtype`
    `int` | `start`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalRequestFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.solr.request.LocalSolrQueryRequest` | `makeRequest(String... q)` Creates a LocalSolrQueryRequest based on variable args; for historical reasons, this method has some peculiar behavior: If there is a single arg, then it is treated as the "q" param, and the LocalSolrQueryRequest consists of that query string along with "qt", "start", and "rows" params (based on the qtype, start, and limit properties of this factory) along with any other default "args" set on this factory.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### qtype

          public String qtype

    - #### start

          public int start

    - #### limit

          public int limit

    - #### args

          public Map<String,String> args

  - ### Constructor Detail

    - #### LocalRequestFactory

          public LocalRequestFactory()

  - ### Method Detail

    - #### makeRequest

          public org.apache.solr.request.LocalSolrQueryRequest makeRequest(String... q)

      Creates a LocalSolrQueryRequest based on variable args; for historical reasons, this method has some peculiar behavior:
      - If there is a single arg, then it is treated as the "q" param, and the LocalSolrQueryRequest consists of that query string along with "qt", "start", and "rows" params (based on the qtype, start, and limit properties of this factory) along with any other default "args" set on this factory.
      - If there are multiple args, then there must be an even number of them, and each pair of args is used as a key=value param in the LocalSolrQueryRequest. NOTE: In this usage, the "qtype", "start", "limit", and "args" properties of this factory are ignored.
      TODO: this isn't really safe in the presense of core reloads! Perhaps the best we could do is increment the core reference count and decrement it in the request close() method?

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.