Package org.mycore.solr.search
Class MCRSolrSearchUtils
java.lang.Object
org.mycore.solr.search.MCRSolrSearchUtils
Some solr search utils.
- Author:
- Matthias Eichner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Spliterator for solr documents. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.solr.common.SolrDocument
Returns the first document.static org.apache.solr.client.solrj.SolrQuery
getSolrQuery
(MCRQuery query, Document input, jakarta.servlet.http.HttpServletRequest request) Returns a list of ids found by the given query.static Stream<org.apache.solr.common.SolrDocument>
stream
(org.apache.solr.client.solrj.SolrClient solrClient, org.apache.solr.common.params.SolrParams params) Creates a stream of SolrDocument's.static Stream<org.apache.solr.common.SolrDocument>
stream
(org.apache.solr.client.solrj.SolrClient solrClient, org.apache.solr.common.params.SolrParams params, boolean parallel, int rowsPerRequest)
-
Constructor Details
-
MCRSolrSearchUtils
public MCRSolrSearchUtils()
-
-
Method Details
-
first
public static org.apache.solr.common.SolrDocument first(org.apache.solr.client.solrj.SolrClient solrClient, String query) throws org.apache.solr.client.solrj.SolrServerException, IOException Returns the first document.- Parameters:
solrClient
- solr server connectionquery
- solr query- Returns:
- first solr document or null
- Throws:
org.apache.solr.client.solrj.SolrServerException
- communication with the solr server failed in any wayIOException
-
getSolrQuery
-
listIDs
public static List<String> listIDs(org.apache.solr.client.solrj.SolrClient solrClient, String query) Returns a list of ids found by the given query. Returns an empty list when nothing is found.- Parameters:
solrClient
- solr server connectionquery
- solr query- Returns:
- list of id's
-
stream
public static Stream<org.apache.solr.common.SolrDocument> stream(org.apache.solr.client.solrj.SolrClient solrClient, org.apache.solr.common.params.SolrParams params) Creates a stream of SolrDocument's.- Parameters:
solrClient
- the client to queryparams
- solr parameter- Returns:
- stream of solr documents
-
stream
public static Stream<org.apache.solr.common.SolrDocument> stream(org.apache.solr.client.solrj.SolrClient solrClient, org.apache.solr.common.params.SolrParams params, boolean parallel, int rowsPerRequest)
-