public interface SearchService<T extends Query> extends QueryFactory<T>
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits any pending changes made to the search engine's default index.
|
void |
commit(String indexId)
Commits any pending changes made to the search engine's default index.
|
void |
delete(String site,
String id)
Deletes the search engine's index data of an XML document.
|
void |
delete(String indexId,
String site,
String id)
Deletes the search engine's index data of an XML document.
|
Map<String,Object> |
search(String indexId,
T query)
Does a full-text search and returns a Map model.
|
Map<String,Object> |
search(T query)
Does a full-text search and returns a Map model.
|
void |
update(String site,
String id,
String xml,
boolean ignoreRootInFieldNames)
Updates the search engine's index data of an XML document.
|
void |
update(String indexId,
String site,
String id,
String xml,
boolean ignoreRootInFieldNames)
Updates the search engine's index data of an XML document.
|
void |
updateContent(String site,
String id,
org.craftercms.core.service.Content content)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String site,
String id,
org.craftercms.core.service.Content content,
Map<String,List<String>> additionalFields)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String site,
String id,
File file)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String site,
String id,
File file,
Map<String,List<String>> additionalFields)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String indexId,
String site,
String id,
org.craftercms.core.service.Content content)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String indexId,
String site,
String id,
org.craftercms.core.service.Content content,
Map<String,List<String>> additionalFields)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String indexId,
String site,
String id,
File file)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
void |
updateContent(String indexId,
String site,
String id,
File file,
Map<String,List<String>> additionalFields)
Updates the search engine's index data of a binary or structured document (PDF, Word, Office).
|
createQuery, createQuery
Map<String,Object> search(T query) throws SearchException
query
- the query objectSearchException
- if any error occurs that makes the search failMap<String,Object> search(String indexId, T query) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.query
- the query objectSearchException
- if any error occurs that makes the search failvoid update(String site, String id, String xml, boolean ignoreRootInFieldNames) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the XML document, within the sitexml
- the XML document to update in the indexignoreRootInFieldNames
- ignore the root element of the input XML in field namesSearchException
void update(String indexId, String site, String id, String xml, boolean ignoreRootInFieldNames) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the XML document, within the sitexml
- the XML document to update in the indexignoreRootInFieldNames
- ignore the root element of the input XML in field namesSearchException
void delete(String site, String id) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the content, within the siteSearchException
void delete(String indexId, String site, String id) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the content, within the siteSearchException
void updateContent(String site, String id, File file) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the file, within the sitefile
- the file content to update in the indexSearchException
void updateContent(String indexId, String site, String id, File file) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the file, within the sitefile
- the file content to update in the indexSearchException
void updateContent(String site, String id, File file, Map<String,List<String>> additionalFields) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the file, within the sitefile
- the file content to update in the indexadditionalFields
- additional metadata fields to be indexed (shouldn't have the name site, id or
document)SearchException
void updateContent(String indexId, String site, String id, File file, Map<String,List<String>> additionalFields) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the XML document, within the sitefile
- the file content to update in the indexadditionalFields
- additional metadata fields to be indexed (shouldn't have the name site, id or
document)SearchException
void updateContent(String site, String id, org.craftercms.core.service.Content content) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the file, within the sitecontent
- the file content to update in the indexSearchException
void updateContent(String indexId, String site, String id, org.craftercms.core.service.Content content) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the file, within the sitecontent
- the file content to update in the indexSearchException
void updateContent(String site, String id, org.craftercms.core.service.Content content, Map<String,List<String>> additionalFields) throws SearchException
site
- the Crafter site name the content belongs toid
- the id of the file, within the sitecontent
- the file content to update in the indexadditionalFields
- additional metadata fields to be indexed (shouldn't have the name site, id or
document)SearchException
void updateContent(String indexId, String site, String id, org.craftercms.core.service.Content content, Map<String,List<String>> additionalFields) throws SearchException
indexId
- the index ID (core in Solr terminology). Use null for default index.site
- the Crafter site name the content belongs toid
- the id of the XML document, within the sitecontent
- the file content to update in the indexadditionalFields
- additional metadata fields to be indexed (shouldn't have the name site, id or
document)SearchException
void commit() throws SearchException
SearchException
void commit(String indexId) throws SearchException
SearchException
Copyright © 2019 CrafterCMS. All rights reserved.