Interface SolrSuggestionStorageService

All Known Implementing Classes:
SolrSuggestionStorageServiceImpl

public interface SolrSuggestionStorageService
Service to deal with the local suggestion solr core used by the SolrSuggestionProvider(s)
Author:
Andrea Bollini (andrea.bollini at 4science dot it), Luca Giamminonni (luca.giamminonni at 4science dot it)
  • Field Details

  • Method Details

    • addSuggestion

      void addSuggestion(Suggestion suggestion, boolean force, boolean commit) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Add a new suggestion to SOLR
      Parameters:
      suggestion -
      force - true if the suggestion must be reindexed
      commit -
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • exist

      boolean exist(Suggestion suggestion) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Return true if the suggestion is already in SOLR and flagged as processed
      Parameters:
      suggestion -
      Returns:
      true if the suggestion is already in SOLR and flagged as processed
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • deleteSuggestion

      void deleteSuggestion(Suggestion suggestion) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Delete a suggestion from SOLR if any
      Parameters:
      suggestion -
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • flagSuggestionAsProcessed

      void flagSuggestionAsProcessed(Suggestion suggestion) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Flag a suggestion as processed in SOLR if any
      Parameters:
      suggestion -
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • deleteTarget

      void deleteTarget(SuggestionTarget target) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Delete all the suggestions from SOLR if any related to a specific target
      Parameters:
      target -
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • commit

      void commit() throws org.apache.solr.client.solrj.SolrServerException, IOException
      Performs an explicit commit, causing pending documents to be committed for indexing.
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • flagAllSuggestionAsProcessed

      void flagAllSuggestionAsProcessed(String source, String idPart) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Flag all the suggestion related to the given source and id as processed.
      Parameters:
      source - the source name
      idPart - the id's last part
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • countAllTargets

      long countAllTargets(Context context, String source) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Count all the targets related to the given source.
      Parameters:
      source - the source name
      Returns:
      the target's count
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • countUnprocessedSuggestionByTarget

      long countUnprocessedSuggestionByTarget(Context context, String source, UUID target) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Count all the unprocessed suggestions related to the given source and target.
      Parameters:
      context - the DSpace Context
      source - the source name
      target - the target id
      Returns:
      the suggestion count
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • findAllUnprocessedSuggestions

      List<Suggestion> findAllUnprocessedSuggestions(Context context, String source, UUID target, int pageSize, long offset, boolean ascending) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Find all the unprocessed suggestions related to the given source and target.
      Parameters:
      context - the DSpace Context
      source - the source name
      target - the target id
      pageSize - the page size
      offset - the page offset
      ascending - true to retrieve the suggestions ordered by score ascending
      Returns:
      the found suggestions
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • findAllTargets

      List<SuggestionTarget> findAllTargets(Context context, String source, int pageSize, long offset) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Find all the suggestion targets related to the given source.
      Parameters:
      context - the DSpace Context
      source - the source name
      pageSize - the page size
      offset - the page offset
      Returns:
      the found suggestion targets
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • findUnprocessedSuggestion

      Suggestion findUnprocessedSuggestion(Context context, String source, UUID target, String id) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Find an unprocessed suggestion by the given source, target id and suggestion id.
      Parameters:
      context - the DSpace Context
      source - the source name
      target - the target id
      id - the suggestion id
      Returns:
      the suggestion, if any
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • findTarget

      SuggestionTarget findTarget(Context context, String source, UUID target) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Find a suggestion target by the given source and target.
      Parameters:
      context - the DSpace Context
      source - the source name
      target - the target id
      Returns:
      the suggestion target, if any
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException