See: Description
Interface | Description |
---|---|
AlgorithmDefinition |
Definition of an Algorithm.
|
FilteredValueConfiguration |
Representation of a filtered value's table configuration.
|
FilteredValueGroupConfiguration |
Representation of a filtered value group's table configuration.
|
HistoryOperations |
Operations used to handle search history.
|
NodeKey |
Stores the detailed scores
|
RepositorySearchResult |
Represents the search result for a search performed in the scope of a repository.
|
SearchConfiguration |
Representation of a dataset configuration.
|
SearchFieldConfiguration |
Representation of a field configuration.
|
SearchHistory |
Represents the history of a search operation.
|
SearchOperations |
Operations used to search.
|
SearchTableConfiguration |
Representation of a table configuration.
|
SearchTextNormalizer |
Filter that can be used to normalize the text.
|
TableSearchResult |
Represents the search result for a table.
|
Class | Description |
---|---|
AlgorithmCatalog |
Catalog to register algorithms.
|
AlgorithmDefinitionContext |
Context for an AlgorithmDefinition.
|
DatasetSearchResult |
Represents the result of a search.
|
DiacriticsNormalizer |
Filter that removes all the diacritics on the letters.
|
FuzzyAlgorithmConfiguration |
Definition of a FuzzyFullText algorithm configuration.
|
HistoryOperationsFactory |
Factory for history operations available to the {addon.label}.
|
InputParameter |
Represents the input parameter for an algorithm.
|
LoadCacheContext |
Context used to load the search cache.
|
ParameterDefinition |
Represents a parameter definition for an algorithm.
|
RecordSearchResult |
Represents the result of a search.
|
RepositorySearchContext |
Defines the repository search context for the execution of
SearchOperations.search(RepositorySearchContext) . |
SearchAlgorithmConfiguration |
Definition of a Algorithm configuration.
|
SearchComparator |
Abstract class for search and comparison algorithms.
|
SearchComparatorBuilder |
Builder class to instantiate different types of SearchComparator.
|
SearchConfigurationContext |
Context to which the configuration is associated.
|
SearchContext |
Defines the context for the execution of
SearchOperations.searchDataset(SearchContext) . |
SearchDistance |
Abstract class for implementing distance algorithms.
|
SearchDistanceObject |
Abstract class for implementing distance algorithms between types.
|
SearchOperationsFactory |
Factory for Operations available to the {addon.label}.
|
SearchSelectionMode |
Representation of search modes.
|
SearchTableFilter |
Represents the search panel that is used to extend the EBX® table filter.
|
SearchValueFilter |
Removes all the values declared in the search configuration before searching.
|
SynonymGroup |
Represents synonyms group of matching field value.
|
TableDescriptor |
Defines all properties required to indicate an
AdaptationTable . |
Provides classes and interfaces required for the Search and History operations. It ispossible implement a custom algorithm also.
Before executing a search, you must first define a configuration for the {addon.label}.
//Dataset in which you want to perform a search Adaptation dataset; SearchConfigurationContext context = new SearchConfigurationContext(); context.setDataset(dataset); SearchConfiguration configuration = SearchOperationsFactory.getSearchOperations() .getConfiguration(context); List<SearchTableConfiguration> tableConfigurations = configuration.getTablesConfigurations() List<SchemaNode> tableSelecteds = new ArrayList<SchemaNode>(); for(SearchTableConfiguration tableConfig : tableConfigurations) { AdaptationTable tableItem = dataset.getTable(tableConfig.getTablePath()); tableSelecteds.add(tableItem.getTableNode()); } SearchContext searchContext = new SearchContext( dataset, Locale.US, tableSelecteds, searchText, //Search term BigDecimal.valueOf(configuration.getSensitivityDefaultValue()), session); DatasetSearchResult datasetResult= SearchOperationsFactory.getSearchOperations().searchDataset(searchContext);
To launch a search at the repository level, do as follows:
//the repository to search Repository repository; //a table in the repository to search AdaptationTable table1; //another table to search Path tablePath; HomeKey homeKey; AdaptationName adaptationName; List<TableDescriptor> tableDescriptors = new ArrayList<TableDescriptor>(); TableDescriptor tableDescriptor1 = new TableDescriptor(table1); TableDescriptor tableDescriptor2 = new TableDescriptor(tablePath, adaptationName, homeKey); tableDescriptors.add(tableDescriptor1); tableDescriptors.add(tableDescriptor2); //keyword used to search String query = "keyword"; //save the search history or not. boolean savedToHistory = false; //current user session Session session; RepositorySearchContext searchContext = new RepositorySearchContext( repository, tableDescriptors, query, savedToHistory, session); RepositorySearchResult searchResult = SearchOperationsFactory.getSearchOperations() .search(searchContext);
Sample usage of HistoryOperations.
Repository repository; Session session; Adaptation dataset; AdaptationTable table; HistoryOperations historyOperations = HistoryOperationsFactory.getHistoryOperations(); //Deletes all records in the History table for the current user at the repository search scope. historyOperations.clearRepositorySearchHistory(repository, session); //Deletes all records in the History table for the current user at the dataset search scope. historyOperations.clearDatasetSearchHistory(repository, dataset, session); //Deletes all records in the History table for the current user at the table search scope. historyOperations.clearTableSearchHistory(repository, new TableDescriptor(table), session);
To implement a custom algorithm, do as follows:
Firstly, define a custom algorithm by extending the SearchDistance interface:
public class CustomAlgorithmDefinition implements AlgorithmDefinition { public List<ParameterDefinition> getParameters() { return null; } public SearchComparator getAlgorithm(AlgorithmDefinitionContext adContext) { if (adContext == null) { return new CustomAlgorithm(null, Locale.US); } return new CustomAlgorithm(adContext.getField(), adContext.getLocale()); } public Class<SearchAlgorithmConfiguration> getSearchConfigurationClass() { return SearchAlgorithmConfiguration.class; } public UserMessage checkParameterValueRange(List<InputParameter> parameters, Locale locale) { return null; } }
Secondly, define the a Definition class:
public class CustomAlgorithmDefinition implements AlgorithmDefinition { public List<ParameterDefinition> getParameters() { return null; } public SearchComparator getAlgorithm(AlgorithmDefinitionContext adContext) { if (adContext == null) { return new CustomAlgorithm(null, Locale.US); } return new CustomAlgorithm(adContext.getField(), adContext.getLocale()); } public Class<SearchAlgorithmConfiguration> getSearchConfigurationClass() { return SearchAlgorithmConfiguration.class; } public UserMessage checkParameterValueRange(List<InputParameter> parameters, Locale locale) { return null; } }
Finally, register the algorithm:
AlgorithmCatalog.add(new CustomAlgorithmDefinition());