public class SchemaService extends Object
The schema is defined by the following properties:
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS |
static List<String> |
DEFAULT_NOANALYZE_FIELD_LIST |
static List<String> |
DEFAULT_SEARCH_FIELD_LIST |
static List<String> |
DEFAULT_STORE_FIELD_LIST |
| Constructor and Description |
|---|
SchemaService() |
| Modifier and Type | Method and Description |
|---|---|
String |
escapeSearchTerm(String searchTerm) |
String |
escapeSearchTerm(String searchTerm,
boolean ignoreBracket)
This helper method escapes special characters found in a lucene search term.
|
ItemCollection |
getConfiguration()
Returns the Lucene schema configuration
|
String |
getExtendedSearchTerm(String sSearchTerm)
Returns the extended search term for a given query.
|
List<String> |
getFieldList()
Returns the field list defining the default content of the schema.
|
List<String> |
getFieldListAnalyze()
Returns the analyzed field list of the schema.
|
List<String> |
getFieldListNoAnalyze()
Returns the no-analyze field list of the schema.
|
List<String> |
getFieldListStore()
Returns the field list of items stored in the index.
|
Set<String> |
getUniqueFieldList()
Returns a unique list of all fields part of the index schema.
|
String |
normalizeSearchTerm(String searchTerm)
This method normalizes a search term.
|
public static final String ANONYMOUS
public List<String> getFieldList()
public List<String> getFieldListAnalyze()
public List<String> getFieldListNoAnalyze()
public List<String> getFieldListStore()
public Set<String> getUniqueFieldList()
public ItemCollection getConfiguration()
public String getExtendedSearchTerm(String sSearchTerm) throws QueryException
sSearchTerm - QueryException - in case the searchtem is not understandable.public String escapeSearchTerm(String searchTerm, boolean ignoreBracket)
Special characters are characters that are part of the lucene query syntax
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ /
Clients should use the method normalizeSearchTerm() instead of escapeSearchTerm() to prepare a user input for a lucene search.
searchTerm - ignoreBracket - - if true brackes will not be escaped.normalizeSearchTermpublic String normalizeSearchTerm(String searchTerm)
e.g. 'europe/berlin' will be normalized to 'europe berlin'
In case the searchTerm contains numbers the method escapes special characters instead of replacing with a blank:
e.g. 'r-555/333' will be converted into 'r\-555\/333'
Special characters are characters that are part of the lucene query syntax
+ - && || ! ( ) { } [ ] ^ " ~ ? : \ /
searchTerm - Copyright © 2006–2020 Imixs Software Solutions GmbH. All rights reserved.