Interface SolrLoggerService

  • All Known Implementing Classes:
    SolrLoggerServiceImpl

    public interface SolrLoggerService
    Static holder for a HttpSolrClient connection pool to issue usage logging events to Solr from DSpace libraries, and some static query composers.
    Author:
    ben at atmire.com, kevinvandevelde at atmire.com, mdiggory at atmire.com
    • Method Detail

      • post

        void post​(DSpaceObject dspaceObject,
                  javax.servlet.http.HttpServletRequest request,
                  EPerson currentUser)
        Deprecated.
        Old post method, use the new postview method instead !
        Parameters:
        dspaceObject - the object used.
        request - the current request context.
        currentUser - the current session's user.
      • postView

        void postView​(DSpaceObject dspaceObject,
                      javax.servlet.http.HttpServletRequest request,
                      EPerson currentUser)
        Store a usage event into Solr.
        Parameters:
        dspaceObject - the object used.
        request - the current request context.
        currentUser - the current session's user.
      • storeParents

        void storeParents​(org.apache.solr.common.SolrInputDocument doc1,
                          DSpaceObject dso)
                   throws SQLException
        Method just used to log the parents.
        • Community log: owning comms.
        • Collection log: owning comms and their comms.
        • Item log: owning colls/comms.
        • Bitstream log: owning item/colls/comms.
        Parameters:
        doc1 - the current SolrInputDocument
        dso - the current dspace object we want to log
        Throws:
        SQLException - if database error ignore it
      • isUseProxies

        boolean isUseProxies()
      • removeIndex

        void removeIndex​(String query)
                  throws IOException,
                         org.apache.solr.client.solrj.SolrServerException
        Delete data from the index, as described by a query.
        Parameters:
        query - description of the records to be deleted.
        Throws:
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        org.apache.solr.client.solrj.SolrServerException - Exception from the Solr server to the solrj Java client.
      • markRobotsByIP

        void markRobotsByIP()
      • markRobotByUserAgent

        void markRobotByUserAgent​(String agent)
      • deleteRobotsByIsBotFlag

        void deleteRobotsByIsBotFlag()
      • deleteIP

        void deleteIP​(String ip)
      • deleteRobotsByIP

        void deleteRobotsByIP()
      • query

        void query​(String query,
                   int max)
            throws org.apache.solr.client.solrj.SolrServerException,
                   IOException
        Throws:
        org.apache.solr.client.solrj.SolrServerException
        IOException
      • queryFacetField

        ObjectCount[] queryFacetField​(String query,
                                      String filterQuery,
                                      String facetField,
                                      int max,
                                      boolean showTotal,
                                      List<String> facetQueries)
                               throws org.apache.solr.client.solrj.SolrServerException,
                                      IOException
        Query used to get values grouped by the given facet field.
        Parameters:
        query - the query to be used
        filterQuery - filter query
        facetField - the facet field on which to group our values
        max - the max number of values given back (in case of 10 the top 10 will be given)
        showTotal - a boolean determining whether the total amount should be given back as the last element of the array
        facetQueries - list of facet queries
        Returns:
        an array containing our results
        Throws:
        org.apache.solr.client.solrj.SolrServerException - Exception from the Solr server to the solrj Java client.
        IOException - passed through.
      • queryFacetDate

        ObjectCount[] queryFacetDate​(String query,
                                     String filterQuery,
                                     int max,
                                     String dateType,
                                     String dateStart,
                                     String dateEnd,
                                     boolean showTotal,
                                     Context context)
                              throws org.apache.solr.client.solrj.SolrServerException,
                                     IOException
        Query used to get values grouped by the date.
        Parameters:
        query - the query to be used
        filterQuery - filter query
        max - the max number of values given back (in case of 10 the top 10 will be given)
        dateType - the type to be used (example: DAY, MONTH, YEAR)
        dateStart - the start date Format:(-3, -2, ..) the date is calculated relatively on today
        dateEnd - the end date stop Format (-2, +1, ..) the date is calculated relatively on today
        showTotal - a boolean determining whether the total amount should be given back as the last element of the array
        context - The relevant DSpace Context.
        Returns:
        and array containing our results
        Throws:
        org.apache.solr.client.solrj.SolrServerException - Exception from the Solr server to the solrj Java client.
        IOException - passed through.
      • query

        org.apache.solr.client.solrj.response.QueryResponse query​(String query,
                                                                  String filterQuery,
                                                                  String facetField,
                                                                  int rows,
                                                                  int max,
                                                                  String dateType,
                                                                  String dateStart,
                                                                  String dateEnd,
                                                                  List<String> facetQueries,
                                                                  String sort,
                                                                  boolean ascending)
                                                           throws org.apache.solr.client.solrj.SolrServerException,
                                                                  IOException
        Throws:
        org.apache.solr.client.solrj.SolrServerException
        IOException
      • getIgnoreSpiderIPs

        String getIgnoreSpiderIPs()
        Returns in a filterQuery string all the ip addresses that should be ignored
        Returns:
        a string query with ip addresses
      • optimizeSOLR

        void optimizeSOLR()
        Maintenance to keep a SOLR index efficient. Note: This might take a long time.
      • shardSolrIndex

        void shardSolrIndex()
                     throws IOException,
                            org.apache.solr.client.solrj.SolrServerException
        Throws:
        IOException
        org.apache.solr.client.solrj.SolrServerException
      • reindexBitstreamHits

        void reindexBitstreamHits​(boolean removeDeletedBitstreams)
                           throws Exception
        Throws:
        Exception
      • exportHits

        void exportHits()
                 throws Exception
        Export all SOLR usage statistics for viewing/downloading content to a flat text file. The file goes to a series
        Throws:
        Exception - if error