Class ClientUtils
- java.lang.Object
-
- org.apache.solr.client.solrj.util.ClientUtils
-
public class ClientUtils extends Object
- Since:
- solr 1.3
-
-
Constructor Summary
Constructors Constructor Description ClientUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addSlices(Map<String,Slice> target, String collectionName, Collection<Slice> slices, boolean multiCollection)
Constructs a slices map from a collection of slices and handles disambiguation if multiple collections are being queried simultaneouslystatic String
encodeLocalParamVal(String val)
Returns the value encoded properly so it can be appended after astatic String
escapeQueryChars(String s)
See: Lucene query parser syntax for more information on Escaping Special Charactersstatic boolean
shouldApplyDefaultCollection(String providedCollection, SolrRequest<? extends SolrResponse> request)
Determines whether any SolrClient "default" collection should applied to the specified requeststatic Collection<ContentStream>
toContentStreams(String str, String contentType)
Take a string and make it an iterable ContentStreamstatic String
toXML(SolrInputDocument doc)
static void
writeXML(SolrInputDocument doc, Writer writer)
-
-
-
Field Detail
-
TEXT_XML
public static final String TEXT_XML
- See Also:
- Constant Field Values
-
TEXT_JSON
public static final String TEXT_JSON
- See Also:
- Constant Field Values
-
-
Method Detail
-
toContentStreams
public static Collection<ContentStream> toContentStreams(String str, String contentType)
Take a string and make it an iterable ContentStream
-
writeXML
public static void writeXML(SolrInputDocument doc, Writer writer) throws IOException
- Throws:
IOException
-
toXML
public static String toXML(SolrInputDocument doc)
-
escapeQueryChars
public static String escapeQueryChars(String s)
See: Lucene query parser syntax for more information on Escaping Special Characters
-
encodeLocalParamVal
public static String encodeLocalParamVal(String val)
Returns the value encoded properly so it can be appended after aname=
local-param.
-
addSlices
public static void addSlices(Map<String,Slice> target, String collectionName, Collection<Slice> slices, boolean multiCollection)
Constructs a slices map from a collection of slices and handles disambiguation if multiple collections are being queried simultaneously
-
shouldApplyDefaultCollection
public static boolean shouldApplyDefaultCollection(String providedCollection, SolrRequest<? extends SolrResponse> request)
Determines whether any SolrClient "default" collection should applied to the specified request- Parameters:
providedCollection
- a collection/core explicitly provided to the SolrClient (typically throughSolrClient.request(SolrRequest, String)
request
- theSolrRequest
being executed
-
-