org.apache.solr.request
Class SolrParams

java.lang.Object
  extended by org.apache.solr.request.SolrParams
Direct Known Subclasses:
DefaultSolrParams, MapSolrParams, MultiMapSolrParams, RequiredSolrParams

public abstract class SolrParams
extends java.lang.Object

SolrParams hold request parameters.

Version:
$Id$
Author:
yonik

Nested Class Summary
static class SolrParams.EchoParamStyle
          valid values for: echoParams
 
Field Summary
static java.lang.String DEBUG_QUERY
          whether to include debug data
static java.lang.String DF
          default query field
static java.lang.String EXPLAIN_OTHER
          another query to explain against
static java.lang.String FACET
          Should facet counts be calculated?
static java.lang.String FACET_ENUM_CACHE_MINDF
          When faceting by enumerating the terms in a field, only use the filterCache for terms with a df >= to this parameter.
static java.lang.String FACET_FIELD
          Any field whose terms the user wants to enumerate over for Facet Contraint Counts (multi-value)
static java.lang.String FACET_LIMIT
          Numeric option indicating the maximum number of facet field counts be included in the response for each field - in descending order of count.
static java.lang.String FACET_MINCOUNT
          Numeric option indicating the minimum number of hits before a facet should be included in the response.
static java.lang.String FACET_MISSING
          Boolean option indicating whether the response should include a facet field count for all records which have no value for the facet field.
static java.lang.String FACET_OFFSET
          The offset into the list of facets.
static java.lang.String FACET_PREFIX
          Only return constraints of a facet field with the given prefix.
static java.lang.String FACET_QUERY
          Any lucene formated queries the user would like to use for Facet Contraint Counts (multi-value)
static java.lang.String FACET_SORT
          Boolean option: true causes facets to be sorted by the count, false results in natural index order.
static java.lang.String FACET_ZEROS
          Boolean option indicating whether facet field counts of "0" should be included in the response.
static java.lang.String FL
          query and init param for field list
static java.lang.String FQ
          Lucene query string(s) for filtering the results without affecting scoring
static java.lang.String HEADER_ECHO_HANDLER
          'true' if the header should include the handler name
static java.lang.String HEADER_ECHO_PARAMS
          include the parameters in the header
static java.lang.String Q
          query string
static java.lang.String QT
          the query type - which query handler should handle the request
static java.lang.String ROWS
          number of documents to return starting at "start"
static java.lang.String SORT
          sort order
static java.lang.String START
          zero based offset of matching documents to retrieve
static java.lang.String STREAM_BODY
          If the content stream should come directly from a field
static java.lang.String STREAM_CONTENTTYPE
          Explicity set the content type for the input stream If multiple streams are specified, the explicit contentType will be used for all of them.
static java.lang.String STREAM_FILE
          If the content stream should come from a File (using FileReader)
static java.lang.String STREAM_URL
          If the content stream should come from a URL (using URLConnection)
static java.lang.String VERSION
          stylesheet to apply to XML results
static java.lang.String WT
          the response writer type - the format of the response
static java.lang.String XSL
          stylesheet to apply to XML results
 
Constructor Summary
SolrParams()
           
 
Method Summary
protected  java.lang.String fpname(java.lang.String field, java.lang.String param)
           
abstract  java.lang.String get(java.lang.String param)
          returns the String value of a param, or null if not set
 java.lang.String get(java.lang.String param, java.lang.String def)
          returns the value of the param, or def if not set
 java.lang.Boolean getBool(java.lang.String param)
          Returns the Boolean value of the param, or null if not set
 boolean getBool(java.lang.String param, boolean def)
          Returns the boolean value of the param, or def if not set
 java.lang.Boolean getFieldBool(java.lang.String field, java.lang.String param)
          Returns the Boolean value of the field param, or the value for param, or null if neither is set.
 boolean getFieldBool(java.lang.String field, java.lang.String param, boolean def)
          Returns the boolean value of the field param, or the value for param, or def if neither is set.
 java.lang.Float getFieldFloat(java.lang.String field, java.lang.String param)
          Returns the float value of the field param.
 float getFieldFloat(java.lang.String field, java.lang.String param, float def)
          Returns the float value of the field param, or the value for param, or def if neither is set.
 java.lang.Integer getFieldInt(java.lang.String field, java.lang.String param)
          Returns the int value of the field param, or the value for param, or def if neither is set.
 int getFieldInt(java.lang.String field, java.lang.String param, int def)
          Returns the int value of the field param, or the value for param, or def if neither is set.
 java.lang.String getFieldParam(java.lang.String field, java.lang.String param)
          returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.
 java.lang.String getFieldParam(java.lang.String field, java.lang.String param, java.lang.String def)
          returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.
 java.lang.String[] getFieldParams(java.lang.String field, java.lang.String param)
          returns the String values of the field parameter, "f.field.param", or the values for "param" if that is not set.
 java.lang.Float getFloat(java.lang.String param)
          Returns the Float value of the param, or null if not set
 float getFloat(java.lang.String param, float def)
          Returns the float value of the param, or def if not set
 java.lang.Integer getInt(java.lang.String param)
          Returns the Integer value of the param, or null if not set
 int getInt(java.lang.String param, int def)
          Returns the int value of the param, or def if not set
abstract  java.util.Iterator<java.lang.String> getParameterNamesIterator()
          returns an Iterator over the parameter names
abstract  java.lang.String[] getParams(java.lang.String param)
          returns an array of the String values of a param, or null if none
protected  boolean parseBool(java.lang.String s)
          how to transform a String into a boolean...
 RequiredSolrParams required()
          returns a RequiredSolrParams wrapping this
static java.util.Map<java.lang.String,java.lang.String> toMap(NamedList params)
          Create a Map from a NamedList given no keys are repeated
static java.util.Map<java.lang.String,java.lang.String[]> toMultiMap(NamedList params)
          Create a Map from a NamedList
 NamedList<java.lang.Object> toNamedList()
          Convert this to a NamedList
static SolrParams toSolrParams(NamedList params)
          Create SolrParams from NamedList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QT

public static final java.lang.String QT
the query type - which query handler should handle the request

See Also:
Constant Field Values

WT

public static final java.lang.String WT
the response writer type - the format of the response

See Also:
Constant Field Values

Q

public static final java.lang.String Q
query string

See Also:
Constant Field Values

SORT

public static final java.lang.String SORT
sort order

See Also:
Constant Field Values

FQ

public static final java.lang.String FQ
Lucene query string(s) for filtering the results without affecting scoring

See Also:
Constant Field Values

START

public static final java.lang.String START
zero based offset of matching documents to retrieve

See Also:
Constant Field Values

ROWS

public static final java.lang.String ROWS
number of documents to return starting at "start"

See Also:
Constant Field Values

XSL

public static final java.lang.String XSL
stylesheet to apply to XML results

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
stylesheet to apply to XML results

See Also:
Constant Field Values

FL

public static final java.lang.String FL
query and init param for field list

See Also:
Constant Field Values

DF

public static final java.lang.String DF
default query field

See Also:
Constant Field Values

DEBUG_QUERY

public static final java.lang.String DEBUG_QUERY
whether to include debug data

See Also:
Constant Field Values

EXPLAIN_OTHER

public static final java.lang.String EXPLAIN_OTHER
another query to explain against

See Also:
Constant Field Values

FACET

public static final java.lang.String FACET
Should facet counts be calculated?

See Also:
Constant Field Values

FACET_QUERY

public static final java.lang.String FACET_QUERY
Any lucene formated queries the user would like to use for Facet Contraint Counts (multi-value)

See Also:
Constant Field Values

FACET_FIELD

public static final java.lang.String FACET_FIELD
Any field whose terms the user wants to enumerate over for Facet Contraint Counts (multi-value)

See Also:
Constant Field Values

FACET_OFFSET

public static final java.lang.String FACET_OFFSET
The offset into the list of facets. Can be overriden on a per field basis.

See Also:
Constant Field Values

FACET_LIMIT

public static final java.lang.String FACET_LIMIT
Numeric option indicating the maximum number of facet field counts be included in the response for each field - in descending order of count. Can be overriden on a per field basis.

See Also:
Constant Field Values

FACET_MINCOUNT

public static final java.lang.String FACET_MINCOUNT
Numeric option indicating the minimum number of hits before a facet should be included in the response. Can be overriden on a per field basis.

See Also:
Constant Field Values

FACET_ZEROS

public static final java.lang.String FACET_ZEROS
Boolean option indicating whether facet field counts of "0" should be included in the response. Can be overriden on a per field basis.

See Also:
Constant Field Values

FACET_MISSING

public static final java.lang.String FACET_MISSING
Boolean option indicating whether the response should include a facet field count for all records which have no value for the facet field. Can be overriden on a per field basis.

See Also:
Constant Field Values

FACET_SORT

public static final java.lang.String FACET_SORT
Boolean option: true causes facets to be sorted by the count, false results in natural index order.

See Also:
Constant Field Values

FACET_PREFIX

public static final java.lang.String FACET_PREFIX
Only return constraints of a facet field with the given prefix.

See Also:
Constant Field Values

FACET_ENUM_CACHE_MINDF

public static final java.lang.String FACET_ENUM_CACHE_MINDF
When faceting by enumerating the terms in a field, only use the filterCache for terms with a df >= to this parameter.

See Also:
Constant Field Values

STREAM_URL

public static final java.lang.String STREAM_URL
If the content stream should come from a URL (using URLConnection)

See Also:
Constant Field Values

STREAM_FILE

public static final java.lang.String STREAM_FILE
If the content stream should come from a File (using FileReader)

See Also:
Constant Field Values

STREAM_BODY

public static final java.lang.String STREAM_BODY
If the content stream should come directly from a field

See Also:
Constant Field Values

STREAM_CONTENTTYPE

public static final java.lang.String STREAM_CONTENTTYPE
Explicity set the content type for the input stream If multiple streams are specified, the explicit contentType will be used for all of them.

See Also:
Constant Field Values

HEADER_ECHO_HANDLER

public static final java.lang.String HEADER_ECHO_HANDLER
'true' if the header should include the handler name

See Also:
Constant Field Values

HEADER_ECHO_PARAMS

public static final java.lang.String HEADER_ECHO_PARAMS
include the parameters in the header

See Also:
Constant Field Values
Constructor Detail

SolrParams

public SolrParams()
Method Detail

get

public abstract java.lang.String get(java.lang.String param)
returns the String value of a param, or null if not set


getParams

public abstract java.lang.String[] getParams(java.lang.String param)
returns an array of the String values of a param, or null if none


getParameterNamesIterator

public abstract java.util.Iterator<java.lang.String> getParameterNamesIterator()
returns an Iterator over the parameter names


get

public java.lang.String get(java.lang.String param,
                            java.lang.String def)
returns the value of the param, or def if not set


required

public RequiredSolrParams required()
returns a RequiredSolrParams wrapping this


fpname

protected java.lang.String fpname(java.lang.String field,
                                  java.lang.String param)

getFieldParam

public java.lang.String getFieldParam(java.lang.String field,
                                      java.lang.String param)
returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set.


getFieldParam

public java.lang.String getFieldParam(java.lang.String field,
                                      java.lang.String param,
                                      java.lang.String def)
returns the String value of the field parameter, "f.field.param", or the value for "param" if that is not set. If that is not set, def


getFieldParams

public java.lang.String[] getFieldParams(java.lang.String field,
                                         java.lang.String param)
returns the String values of the field parameter, "f.field.param", or the values for "param" if that is not set.


getBool

public java.lang.Boolean getBool(java.lang.String param)
Returns the Boolean value of the param, or null if not set


getBool

public boolean getBool(java.lang.String param,
                       boolean def)
Returns the boolean value of the param, or def if not set


getFieldBool

public java.lang.Boolean getFieldBool(java.lang.String field,
                                      java.lang.String param)
Returns the Boolean value of the field param, or the value for param, or null if neither is set.


getFieldBool

public boolean getFieldBool(java.lang.String field,
                            java.lang.String param,
                            boolean def)
Returns the boolean value of the field param, or the value for param, or def if neither is set.


getInt

public java.lang.Integer getInt(java.lang.String param)
Returns the Integer value of the param, or null if not set


getInt

public int getInt(java.lang.String param,
                  int def)
Returns the int value of the param, or def if not set


getFieldInt

public java.lang.Integer getFieldInt(java.lang.String field,
                                     java.lang.String param)
Returns the int value of the field param, or the value for param, or def if neither is set.


getFieldInt

public int getFieldInt(java.lang.String field,
                       java.lang.String param,
                       int def)
Returns the int value of the field param, or the value for param, or def if neither is set.


getFloat

public java.lang.Float getFloat(java.lang.String param)
Returns the Float value of the param, or null if not set


getFloat

public float getFloat(java.lang.String param,
                      float def)
Returns the float value of the param, or def if not set


getFieldFloat

public java.lang.Float getFieldFloat(java.lang.String field,
                                     java.lang.String param)
Returns the float value of the field param.


getFieldFloat

public float getFieldFloat(java.lang.String field,
                           java.lang.String param,
                           float def)
Returns the float value of the field param, or the value for param, or def if neither is set.


parseBool

protected boolean parseBool(java.lang.String s)
how to transform a String into a boolean... more flexible than Boolean.parseBoolean() to enable easier integration with html forms.


toMap

public static java.util.Map<java.lang.String,java.lang.String> toMap(NamedList params)
Create a Map from a NamedList given no keys are repeated


toMultiMap

public static java.util.Map<java.lang.String,java.lang.String[]> toMultiMap(NamedList params)
Create a Map from a NamedList


toSolrParams

public static SolrParams toSolrParams(NamedList params)
Create SolrParams from NamedList.


toNamedList

public NamedList<java.lang.Object> toNamedList()
Convert this to a NamedList



Copyright © 2006 - 2008 The Apache Software Foundation