Package com.logicaldoc.core.automation

# Class SearchTool

java.lang.Object
com.logicaldoc.core.automation.SearchTool

public class SearchTool extends Object
Utility methods to do searches from within Automation

Since:
  8.6.1
Author:
  Marco Meschieri - LogicalDOC

## Constructor Summary

Constructors
Constructor
Description
`SearchTool()`

## Method Summary

Modifier and Type
Method
Description
`Search`
`newSearch(SearchOptions options)`
Factory method for searches.
`List<Hit>`
`search(long tenantId, String expression, String expressionLanguage)`
Executes a search directly in the full-text index
`List<Hit>`
`search(long tenantId, String expression, Set<String> filters, String expressionLanguage)`
Executes a search directly in the full-text index
`List<Hit>`
`search(SearchOptions options)`
Instantiates a new `Search`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SearchTool

public SearchTool()

## Method Details

### newSearch

public Search newSearch(SearchOptions options)
Factory method for searches.

Parameters:
  `options` - the search criteria
Returns:
  a `Search` instance for the given search options

### search

public List<Hit> search(SearchOptions options) throws SearchException
Instantiates a new `Search`

Parameters:
  `options` - the search criteria
Returns:
  The list of hits that satisfy the search criteria
Throws:
  `SearchException` - Raised in case of an error during the search

### search

public List<Hit> search(long tenantId, String expression, String expressionLanguage)
Executes a search directly in the full-text index

Parameters:
  `tenantId` - the tenant
  `expression` - the search expression
  `expressionLanguage` - the language of the expression
Returns:
  the hits
Since:
  8.7.4

### search

public List<Hit> search(long tenantId, String expression, Set<String> filters, String expressionLanguage)
Executes a search directly in the full-text index

Parameters:
  `tenantId` - the tenant
  `expression` - the search expression
  `filters` - some optional filters
  `expressionLanguage` - the language of the expression
Returns:
  the hits
Since:
  8.7.4