Class MCRSolrSearchUtils

java.lang.Object
org.mycore.solr.search.MCRSolrSearchUtils

public abstract class MCRSolrSearchUtils extends Object
Some solr search utils.
Author:
Matthias Eichner
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Spliterator for solr documents.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.solr.common.SolrDocument
    first(org.apache.solr.client.solrj.SolrClient solrClient, String query)
    Returns the first document.
    static org.apache.solr.client.solrj.SolrQuery
    getSolrQuery(MCRQuery query, Document input, jakarta.servlet.http.HttpServletRequest request)
     
    static List<String>
    listIDs(org.apache.solr.client.solrj.SolrClient solrClient, String query)
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 connection
      query - solr query
      Returns:
      first solr document or null
      Throws:
      org.apache.solr.client.solrj.SolrServerException - communication with the solr server failed in any way
      IOException
    • getSolrQuery

      public static org.apache.solr.client.solrj.SolrQuery getSolrQuery(MCRQuery query, Document input, jakarta.servlet.http.HttpServletRequest request)
    • 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 connection
      query - 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 query
      params - 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)