|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.smila.solr.util.SolrUtils
public final class SolrUtils
SolrUtils class.
Field Summary | |
---|---|
static java.lang.String |
ESCAPE_CHARS
chars, that if part of a term need to be escaped when searching. |
Constructor Summary | |
---|---|
SolrUtils()
|
Method Summary | |
---|---|
static java.lang.String |
encodeQuery(java.lang.String query)
Encode a query into application/x-www-form-urlencoded format. |
static java.lang.String |
escapeQuery(java.lang.String query)
Escapes all chars with a special meaning to the lucene query parser. |
static java.lang.String |
escapeQuery(java.lang.String query,
java.lang.String escapeChars)
Escapes the given chars in the given query by prepending '\'. |
static boolean |
responseStatusIsError(SolrResponseBase response)
returns true if response indicates an error |
static java.lang.String |
toConstQueryOnField(java.lang.String fieldName,
java.lang.String constant)
creates a query string on the given field for a constant which must be searched "as is", i.e. |
static java.lang.String |
toSolrQueryFilter(java.lang.String filter)
Convert a lucene QueryWrapperFilter to a query filter for solr. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ESCAPE_CHARS
Constructor Detail |
---|
public SolrUtils()
Method Detail |
---|
public static java.lang.String encodeQuery(java.lang.String query) throws java.io.UnsupportedEncodingException
query
- the query.
java.io.UnsupportedEncodingException
- UnsupportedEncodingException.public static java.lang.String escapeQuery(java.lang.String query)
query
- the query.
ESCAPE_CHARS
,
toConstQueryOnField(String, String)
public static java.lang.String escapeQuery(java.lang.String query, java.lang.String escapeChars)
query
- the query, if empty nothing happens and it is returned as is.escapeChars
- the chars to escape
public static boolean responseStatusIsError(SolrResponseBase response) throws SolrServerException
SolrServerException
http://lucene.472066.n3.nabble.com/Response-status-td490876.html
public static java.lang.String toSolrQueryFilter(java.lang.String filter)
filter
- the filter.
public static java.lang.String toConstQueryOnField(java.lang.String fieldName, java.lang.String constant)
fieldName
- must not contain whitespace, but this is not checked!constant
- the constant
|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |