public abstract class SearchableEntity
extends sirius.db.es.ElasticEntity
SearchContent
are indexed.
While indexing, we also performe some sanity checks like limiting the min and max width of generated tokens.
The tokenizer uses NON_WORD_CHARACTER
to separate tokens and them provides them
in a whitespace separated format for digestion by Elasticsearch.
Modifier and Type | Field and Description |
---|---|
static sirius.db.mixing.Mapping |
SEARCH_FIELD
Contains the actual search data.
|
static sirius.db.mixing.Mapping |
SEARCHABLE_CONTENT
Contains manually maintained content to be added to the search field.
|
Constructor and Description |
---|
SearchableEntity() |
Modifier and Type | Method and Description |
---|---|
protected void |
addContent(StringBuilder contentBuilder,
Object propertyValue)
Transforms a property value into searchable text.
|
static void |
addContentAsTokens(StringBuilder output,
Object value)
Tokenizes the given string into the given output builder.
|
String |
getSearchableContent() |
String |
getSearchField() |
void |
setSearchableContent(String searchableContent) |
protected void |
updateSearchField() |
public static final sirius.db.mixing.Mapping SEARCHABLE_CONTENT
public static final sirius.db.mixing.Mapping SEARCH_FIELD
protected void updateSearchField()
protected void addContent(StringBuilder contentBuilder, Object propertyValue)
contentBuilder
- the output to write topropertyValue
- the value to transformpublic static void addContentAsTokens(StringBuilder output, Object value)
output
- the builder to write tovalue
- the value to tokenizepublic String getSearchableContent()
public void setSearchableContent(String searchableContent)
public String getSearchField()
Copyright © 2018. All rights reserved.