Package org.dspace.app.suggestion
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThis is the URI Part of the suggestion source:target:idstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSuggestion(Suggestion suggestion, boolean force, boolean commit) Add a new suggestion to SOLRvoidcommit()Performs an explicit commit, causing pending documents to be committed for indexing.longcountAllTargets(Context context, String source) Count all the targets related to the given source.longcountUnprocessedSuggestionByTarget(Context context, String source, UUID target) Count all the unprocessed suggestions related to the given source and target.voiddeleteSuggestion(Suggestion suggestion) Delete a suggestion from SOLR if anyvoiddeleteTarget(SuggestionTarget target) Delete all the suggestions from SOLR if any related to a specific targetbooleanexist(Suggestion suggestion) Return true if the suggestion is already in SOLR and flagged as processedfindAllTargets(Context context, String source, int pageSize, long offset) Find all the suggestion targets related to the given source.findAllUnprocessedSuggestions(Context context, String source, UUID target, int pageSize, long offset, boolean ascending) Find all the unprocessed suggestions related to the given source and target.findTarget(Context context, String source, UUID target) Find a suggestion target by the given source and target.findUnprocessedSuggestion(Context context, String source, UUID target, String id) Find an unprocessed suggestion by the given source, target id and suggestion id.voidflagAllSuggestionAsProcessed(String source, String idPart) Flag all the suggestion related to the given source and id as processed.voidflagSuggestionAsProcessed(Suggestion suggestion) Flag a suggestion as processed in SOLR if any
-
Field Details
-
SOURCE
- See Also:
-
SUGGESTION_FULLID
This is the URI Part of the suggestion source:target:id- See Also:
-
SUGGESTION_ID
- See Also:
-
TARGET_ID
- See Also:
-
TITLE
- See Also:
-
DATE
- See Also:
-
DISPLAY
- See Also:
-
CONTRIBUTORS
- See Also:
-
ABSTRACT
- See Also:
-
CATEGORY
- See Also:
-
EXTERNAL_URI
- See Also:
-
PROCESSED
- See Also:
-
SCORE
- See Also:
-
EVIDENCES
- See Also:
-
-
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 reindexedcommit-- Throws:
IOExceptionorg.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:
IOExceptionorg.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:
IOExceptionorg.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:
IOExceptionorg.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:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
commit
Performs an explicit commit, causing pending documents to be committed for indexing.- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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 nameidPart- the id's last part- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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:
IOExceptionorg.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 Contextsource- the source nametarget- the target id- Returns:
- the suggestion count
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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 Contextsource- the source nametarget- the target idpageSize- the page sizeoffset- the page offsetascending- true to retrieve the suggestions ordered by score ascending- Returns:
- the found suggestions
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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 Contextsource- the source namepageSize- the page sizeoffset- the page offset- Returns:
- the found suggestion targets
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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 Contextsource- the source nametarget- the target idid- the suggestion id- Returns:
- the suggestion, if any
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
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 Contextsource- the source nametarget- the target id- Returns:
- the suggestion target, if any
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-