Interface Index
-
public interface Index
The Interface Index.
Facades the Index and Search process.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FIELD_ID_NAME
static String
FIELD_LANGUAGE_NAME
static String
FIELD_TYPE_NAME
static String
METAFIELD_BOOST_NAME
static String
METAFIELD_FACET_NAME
static String
METAFIELD_OWNER_CLASS_NAME
static String
METAFIELD_TYPES_NAME
static String
METAFIELD_VALUES_CLASS_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
fieldExists(String fieldName)
Returns whether a field exists in the index.List<String>
findDocumentTypes()
Returns a list of all types used in this index.List<nl.gx.webmanager.services.solr.api.FieldDefinition>
findFacetFields(List<String> types, Locale language)
Returns all facet fields that are defined for this index.List<nl.gx.webmanager.services.solr.api.FieldDefinition>
findSearchFields(List<String> types, List<Locale> languages)
Returns all search fields that are defined for this index.List<nl.gx.webmanager.services.solr.api.FieldDefinition>
findStoredFields(List<String> types, List<Locale> languages)
Returns all stored fields that are defined for this index.nl.gx.webmanager.services.solr.api.FieldDefinition
getField(String identifier, Locale language)
Returns the field definition that has the specified identifier.void
optimize()
Optimize.
On callback will optimize the index, merges all possible segments into one complete indexvoid
purgeAll()
Purge All.
Will purge the entire index of all contentvoid
purgeByDomain(List<ContentDomain<?>> contentDomains)
Purge By Domain.
Will purge the entire index of the content which has a type that exists in the givencontentDomains
void
purgeById(List<String> id)
Purge By Id.
Will purge from the index all content matching the given array ofid
.org.apache.solr.client.solrj.response.QueryResponse
query(org.apache.solr.common.params.SolrParams query)
Query.
Exposes aSolrParams
interface and returns a aQueryResponse
.void
update(List<?> content)
Update.
Will update the index with the givencontent
.
-
-
-
Field Detail
-
FIELD_ID_NAME
static final String FIELD_ID_NAME
- See Also:
- Constant Field Values
-
FIELD_TYPE_NAME
static final String FIELD_TYPE_NAME
- See Also:
- Constant Field Values
-
FIELD_LANGUAGE_NAME
static final String FIELD_LANGUAGE_NAME
- See Also:
- Constant Field Values
-
METAFIELD_TYPES_NAME
static final String METAFIELD_TYPES_NAME
- See Also:
- Constant Field Values
-
METAFIELD_OWNER_CLASS_NAME
static final String METAFIELD_OWNER_CLASS_NAME
- See Also:
- Constant Field Values
-
METAFIELD_VALUES_CLASS_NAME
static final String METAFIELD_VALUES_CLASS_NAME
- See Also:
- Constant Field Values
-
METAFIELD_FACET_NAME
static final String METAFIELD_FACET_NAME
- See Also:
- Constant Field Values
-
METAFIELD_BOOST_NAME
static final String METAFIELD_BOOST_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getField
nl.gx.webmanager.services.solr.api.FieldDefinition getField(String identifier, Locale language)
Returns the field definition that has the specified identifier. If possible, the field is returned for the given languages. If not, i.e. a language does not exist for the field, the language agnostic field is returned. The same holds if language is null.- Parameters:
identifier
- the identifierlanguage
- the language of the field to return- Returns:
- the field definition
-
findDocumentTypes
List<String> findDocumentTypes()
Returns a list of all types used in this index.- Returns:
- all document types
-
findStoredFields
List<nl.gx.webmanager.services.solr.api.FieldDefinition> findStoredFields(List<String> types, List<Locale> languages)
Returns all stored fields that are defined for this index.- Parameters:
types
- the (content) type the fields should apply tolanguages
- the languages of the stored fields to retrieve, or an empty list- Returns:
- the stored fields
-
findSearchFields
List<nl.gx.webmanager.services.solr.api.FieldDefinition> findSearchFields(List<String> types, List<Locale> languages)
Returns all search fields that are defined for this index.- Parameters:
types
- the (content) type the fields should apply tolanguages
- the languages of the search fields to retrieve, or an empty list- Returns:
- the search fields
-
findFacetFields
List<nl.gx.webmanager.services.solr.api.FieldDefinition> findFacetFields(List<String> types, Locale language)
Returns all facet fields that are defined for this index.- Parameters:
types
- the (content) type the facets should apply tolanguage
- the language of the facet fields to retrieve, or null- Returns:
- the facet fields
-
fieldExists
boolean fieldExists(String fieldName)
Returns whether a field exists in the index.- Parameters:
fieldName
- the field name- Returns:
- true or false
-
update
void update(List<?> content) throws IndexException
Update.
Will update the index with the givencontent
.- Parameters:
content
- the content to be indexed, may not be null.- Throws:
IndexException
- if an exception occurred during the index process, will wrap the actual cause.
-
purgeById
void purgeById(List<String> id) throws IndexException
Purge By Id.
Will purge from the index all content matching the given array ofid
.- Parameters:
id
- the List of id's to delete, may not be null.- Throws:
IndexException
- if an exception occurred during the delete process, will wrap the actual cause.
-
purgeAll
void purgeAll() throws IndexException
Purge All.
Will purge the entire index of all content- Throws:
IndexException
- the index exception, if an exception occurred during the purging process.
-
purgeByDomain
void purgeByDomain(List<ContentDomain<?>> contentDomains) throws IndexException
Purge By Domain.
Will purge the entire index of the content which has a type that exists in the givencontentDomains
- Parameters:
contentDomains
- the content domains to purge, may not benull
.- Throws:
IndexException
- if any exception occurred during the purge process.
-
optimize
void optimize() throws IndexException
Optimize.
On callback will optimize the index, merges all possible segments into one complete index- Throws:
IndexException
- the index exception
-
query
org.apache.solr.client.solrj.response.QueryResponse query(org.apache.solr.common.params.SolrParams query) throws SearchException
Query.
Exposes aSolrParams
interface and returns a aQueryResponse
.- Parameters:
query
- the query to be executed, may not be null.- Returns:
- the query response returned.
- Throws:
SearchException
- if an exception occurred during the index process, will wrap the actual cause.
-
-