Class GlobalSearch
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.GlobalSearch
- All Implemented Interfaces:
NewerNewStyleService
,STService
-
Field Summary
FieldsFields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Remove from the Lucene index all the information about all projectsvoid
Remove from Lucene index all the information about the not existing projectsvoid
clearSpecificIndex
(String projectName) Remove from the Lucene index all the information of the current projectvoid
clearSpecificIndexUtil
(String projectName) clear the lucene indexes for the selected project andvoid
Create the Lucene index for the current projectvoid
Delete the folder containing the indexes (useful when the indexes, for any reason, cannot be accessed, due to problems with the Lucene version which is different from the one used to create such index)com.fasterxml.jackson.databind.JsonNode
search
(String searchString, List<String> langs, int maxResults, boolean searchInLocalName, boolean caseSensitive, List<String> projects, SearchMode searchMode) Search in the Lucene index all resources/project matching the input stringcom.fasterxml.jackson.databind.JsonNode
translation
(String searchString, @NotEmpty List<String> searchLangs, @NotEmpty List<String> transLangs, boolean caseSensitive, boolean debug) Provide the translations, using Lucene Indexes, for the input term in the desired languagesMethods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Field Details
-
logger
protected static org.slf4j.Logger logger
-
-
Constructor Details
-
GlobalSearch
public GlobalSearch()
-
-
Method Details
-
createIndex
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'pm(project, index)\', \'C\')") public void createIndex() throws ExceptionCreate the Lucene index for the current project- Throws:
Exception
-
clearSpecificIndex
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'pm(project, index)\', \'D\', #projectName)") public void clearSpecificIndex(String projectName) throws Exception Remove from the Lucene index all the information of the current project- Throws:
Exception
-
clearSpecificIndexUtil
clear the lucene indexes for the selected project and- Parameters:
projectName
- the project to remove from the indexes- Throws:
Exception
-
clearAllIndex
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void clearAllIndex() throws ExceptionRemove from the Lucene index all the information about all projects- Throws:
Exception
-
deleteAllIndexes
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void deleteAllIndexes() throws ExceptionDelete the folder containing the indexes (useful when the indexes, for any reason, cannot be accessed, due to problems with the Lucene version which is different from the one used to create such index)- Throws:
Exception
-
clearIndexForNotExistingProjects
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void clearIndexForNotExistingProjects() throws ExceptionRemove from Lucene index all the information about the not existing projects- Throws:
Exception
-
search
@STServiceOperation(method=POST) public com.fasterxml.jackson.databind.JsonNode search(String searchString, @Optional List<String> langs, @Optional(defaultValue="0") int maxResults, @Optional(defaultValue="false") boolean searchInLocalName, @Optional(defaultValue="false") boolean caseSensitive, @Optional List<String> projects, @Optional(defaultValue="exact") SearchMode searchMode) throws Exception Search in the Lucene index all resources/project matching the input string- Parameters:
searchString
-langs
-maxResults
- the maximun number of results to have (0 means no limit)searchInLocalName
- true to search in the local name of resources as well (cannot be set to true while caseSensitive is true as well)caseSensitive
- true to perform a case sensitive search (cannot be set to true while searchInLocalName is true as well)projects
- list of projects to search in. If null, or empty, consider ALL projects)- Throws:
Exception
-
translation
@STServiceOperation public com.fasterxml.jackson.databind.JsonNode translation(String searchString, @NotEmpty @NotEmpty List<String> searchLangs, @NotEmpty @NotEmpty List<String> transLangs, @Optional(defaultValue="false") boolean caseSensitive, @Optional(defaultValue="false") boolean debug) throws Exception Provide the translations, using Lucene Indexes, for the input term in the desired languages- Parameters:
searchString
- the input term for which to search for the translationssearchLangs
- the list of languages where to search the input term. OptionaltransLangs
- the languages for the translationscaseSensitive
- true to perform a case sensitive search. Optional, default value is falsedebug
- true to return more information- Returns:
- Throws:
Exception
-