Class GlobalSearch

java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.GlobalSearch
All Implemented Interfaces:
NewerNewStyleService, STService

@STService public class GlobalSearch extends STServiceAdapter
  • 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 Exception
      Create 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

      public void clearSpecificIndexUtil(String projectName, ClassLoader oldCtxClassLoader) throws Exception
      clear the lucene indexes for the selected project and, if wanted, replace the passed ClassLoader with the passed one
      Parameters:
      projectName - the project to remove from the indexes
      oldCtxClassLoader - if not null, the oldClassLoader to replace the current one, if null, do not do the replace
      Throws:
      Exception
    • clearAllIndex

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void clearAllIndex() throws Exception
      Remove from the Lucene index all the information about all projects
      Throws:
      Exception
    • clearIndexForNotExistingProjects

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void clearIndexForNotExistingProjects() throws Exception
      Remove from Lucene index all the information about the not existing projects
      Throws:
      Exception
    • search

      @STServiceOperation 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 translations
      searchLangs - the list of languages where to search the input term. Optional
      transLangs - the languages for the translations
      caseSensitive - true to perform a case sensitive search. Optional, default value is false
      debug - true to return more information
      Returns:
      Throws:
      Exception