|
SAP NetWeaver 7.40 SP 06 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IIndex
Represents a generic index object of the index management service.
The main properties of an index are:
To get an index object, follow this example:
String indexId = "abc"; IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IIndex index = indexService.getIndex(indexId);Changes between majors releases 7.0 and 7.X
changeIndexedDocumentProperties(com.sapportals.wcm.util.uri.RID, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyNameList, com.sapportals.wcm.repository.IProperty)
changeIndexedDocumentProperties(com.sapportals.wcm.util.uri.RID, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyNameList, boolean)
changeIndexedDocumentProperties(com.sapportals.wcm.util.uri.RID, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyMap, com.sapportals.wcm.repository.IPropertyMap)
deindex(com.sapportals.wcm.service.indexmanagement.retrieval.search.IQueryEntryList)
getSimilarClasses(com.sapportals.wcm.repository.IPropertyName, java.lang.String, int)
IIndexService,
IIndexFolder| Method Summary | |
|---|---|
void |
addFolderUri(URI folderUri)
Deprecated. as of NW04. Use add(IIndexFolder) at the IIndexFolderList interface |
List |
changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyMap defineProperties)
If supported by the search engine (e.g. supported by Trex), this method allows to set property values of indexed documents directly on the server. |
void |
changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyNameList deleteValues,
boolean testQueue)
This method adds and deletes property values for a particular resource on the index server. |
void |
changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyNameList deleteValues,
IProperty testProperty)
This method adds and deletes property values for a particular resource on the index server. |
void |
checkProperties(Properties customProperties)
With this method the properties that should be set could be checked. |
void |
clear()
All documents are removed from the index and the index is set to an initial state. |
void |
createIndexOnServer()
Creates the index on the index server connected with the CM system. |
void |
deindex(IQueryEntryList query)
This method deindexes all resources from the index server fullfilling the query. |
void |
deindexDocument(IResource resource)
Removes a document from the index. |
void |
deindexDocument(RID rid)
Removes a document from the index. |
void |
deindexDocument(URI uri)
Deprecated. as of NW04. Use deindexDocument(RID) |
void |
deindexDocuments(IResourceList resources)
Removes a list of documents from the index It is recommended that you do not deindex documents manually using this method. |
void |
deindexDocuments(IRidList rids)
Removes a list of documents from the index It is recommended that you do not deindex documents manually using this method. |
void |
deindexDocuments(IUriList uris)
Deprecated. as of NW04. Use deindex documents(IRidList) |
void |
delete()
Deprecated. as of NW04. Use deleted(IResourceContext) |
void |
delete(IResourceContext context)
Deletes the index physically Important: To delete an index the deleteIndex(IIndex)
method of the IIndexService interface should be used
instead of this. |
void |
deleteOnServer()
Deletes the index on the index server connected with the CM system. |
void |
deltaReindex()
Performs indexing of the documents that are not yet indexed or have been changed since the last crawl. |
void |
generate()
Deprecated. as of NW04. Use generate(IResourceContext) |
void |
generate(IResourceContext context)
Generates the index physically after creating the index object and initialising it The index data is only saved on CM side if the index could be generated successfully. |
String |
getCrawlerProfileId()
ID of the default crawler profile for all index folders of the index. |
IUriList |
getFolderUris()
Deprecated. as of NW04. Use getIndexFolders() |
IPropertyMap |
getIndexedProperties()
Returns the properties, indexed with the documents in the index. |
IIndexFolder |
getIndexFolderForDocument(RID documentRid)
Gets the index folder according to which the document is assigned to the index Only index folders of this index are checked against the document. |
IIndexFolderList |
getIndexFolders()
Folders or start pages that are assigned to the index for indexing. |
String |
getIndexGroup()
Returns the group of indexes to which the index logically belongs. |
String |
getIndexId()
Identifies the index within the system. |
AbstractIndex.IndexingState |
getIndexingState()
Only for internal usage |
String |
getIndexName()
Non-technical identifier of an index. |
List |
getLanguagesOfIndexedDocuments()
Returns the languages of an index, for which documents exist in. |
Properties |
getProperties()
These properties of the index are only the ones that are specific for an index implementation. |
String |
getResourceInfo(IResource resource)
Returns information about the resource with respect to the actual index e.g. the status of the document as well as general about the index e.g. |
RID |
getRID()
Gets the resource ID of the resource representation of this index. |
ISchedulerTimeTable |
getSchedulerTimeTable()
Returns the timetable of a schedule for delta index crawling for the index. |
String |
getServiceId()
Specifies the index implementation that is used for the index. |
List |
getServiceTypes()
Determines the kind of index A document can only be indexed into one index of an particular service type. |
List |
getServiceTypes(Locale locale)
Displays representations of the indexes service types in the locale's language. |
List |
getSimilarClasses(IPropertyName propName,
String value,
int maxResults)
|
ISupportedOptionSet |
getSupportedOptions()
The actions of the additional interfaces of an index are supported actions for the index in question (for example, ISearchIndex, IClassificationIndex)
that are supported by the index implementation. |
String |
getWhatToIndexString()
String version of what is indexed (collection, simple resource, both) |
void |
indexDocument(IResource resource)
Puts a document into the index. |
void |
indexDocument(IResource resource,
IResourceEvent resourceEvent)
Puts a document into the index It is recommended that you do not index documents manually using this method. |
void |
indexDocuments(IResourceList resources)
Puts a list of documents into the index. |
void |
indexDocuments(IResourceList resources,
IResourceEvent resourceEvent)
Puts a list of documents into the index. |
boolean |
indexInternalLinks()
Checks if internal links should be indexed. |
void |
init(Properties indexProperties)
Initialises the index with data that is specific for an index implementation The implementation is responsible for storing this data. |
boolean |
isActive()
Returns the information if an index is available or has be set inactive. |
int |
reduceNumberOfCrawler()
Only for internal usage |
void |
reindex()
Clears the index (see clear() method) and starts putting all
documents into the index again It may be necessary to reindex an index if a CM repository that is assigned to the index now points to another underlying repository. |
void |
reindex(boolean disablePostClearTasks)
Clears the index (see clear() method) and starts putting all
documents into the index again It may be necessary to reindex an index may be needed if a CM repository that is assigned to the index now points to another underlying repository. |
void |
removeAllFolderUris()
Deprecated. as of NW04. Use clear() at the IIndexFolderList interface |
void |
removeFolderUri(URI folderUri)
Deprecated. as of NW04. Use remove(IIndexFolder) at the IIndexFolderList interface |
boolean |
setActive(boolean isActive)
Sets an index inactive or activates it. |
void |
setActiveDuringStartup(boolean isActive)
Only for internal usage |
void |
setCrawlerProfileId(String crawlerProfileId)
Sets the ID of the default crawler profile for all index folders of the index. |
void |
setInactiveIndexHasChanged()
Sets a property on true, if index documents have changed during index was inactive. |
void |
setIndexGroup(String indexGroup)
Assigns the index to a group of indexes that logically belong together. |
void |
setIndexingState(AbstractIndex.IndexingState state)
Only for internal usage |
void |
setIndexName(String indexName)
Non-technical identifier of an index. |
void |
setProperties(Properties indexProperties)
Saves index data that is specific for an index implementation The implementation is responsible for storing this data. |
void |
setSchedulerTimeTable(ISchedulerTimeTable schedulerTimeTable)
Registers a schedule for delta index crawling for the index with the ISchedulerTimeTable. |
void |
setStateAndNumberOfCrawler(AbstractIndex.IndexingState state,
int numOfCrawler)
Only for internal usage |
void |
setWhatToIndex(String whatToIndex)
Set what should be indexed (collections, simple resources or both) |
boolean |
typeShouldBeIndexed(IResource resource)
Checks if the type (collection, simple resource) should be indexed. |
| Method Detail |
|---|
IPropertyMap getIndexedProperties()
throws WcmException
WcmException - Exception raised in failure situationString getIndexId()
IIndex object
from the IIndexService.
StringString getIndexName()
void addFolderUri(URI folderUri)
folderUri - FolderUri to be addedIUriList getFolderUris()
IIndexFolderList getIndexFolders()
IIndexFolderList. If more than one superior folder
is attached to different indexes, the lower folder determines the index, in which
the document is stored.
IIndexFolder objects that represent the attached folders of the indexString getServiceId()
com.sapportals.wcm.service.indexmanagement.retrieval.trex.TrexSearchAndClassificationIndexISearchIndex, IClassificationIndex
StringString getIndexGroup()
group can be null.
List getServiceTypes()
StringIWcmIndexConst
starting with "SERVICE_TYPE_".List getServiceTypes(Locale locale)
locale - local in which the service type names have to be returned
String in the locale's languageString getCrawlerProfileId()
void removeAllFolderUris()
void removeFolderUri(URI folderUri)
folderUri - URI of the folder to remove from the indexvoid setIndexName(String indexName)
To save the new index name permanently, updateIndex(IIndex) must be called on the
IIndexService interface.
Example:
String indexId = "abc";
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.getIndex(indexId);
index.setIndexName("abc index");
indexService.updateIndex(index);
indexName - display name of the indexvoid setIndexGroup(String indexGroup)
To save the new index group permanently updateIndex(IIndex) must be called on the
IIndexService interface.
Example:
String indexId = "abc";
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.getIndex(indexId);
index.setIndexGroup("intranet");
indexService.updateIndex(index);
indexGroup - group the index has to been assigned to
void setCrawlerProfileId(String crawlerProfileId)
throws WcmException
crawlerProfileId - The new CrawlerProfileId value
WcmException - WcmException if the operation fails
void indexDocuments(IResourceList resources)
throws ResourceException,
WcmException,
IOException
resources - documents to index as IResourceList
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation
void indexDocuments(IResourceList resources,
IResourceEvent resourceEvent)
throws ResourceException,
WcmException,
IOException
resources - documents to index as IResourceListresourceEvent - event that caused the index request
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation
void indexDocument(IResource resource)
throws ResourceException,
WcmException,
IOException
resource - document to index
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation
void indexDocument(IResource resource,
IResourceEvent resourceEvent)
throws ResourceException,
WcmException,
IOException
resource - document to indexresourceEvent -
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation
void deindexDocuments(IResourceList resources)
throws WcmException,
ResourceException
resources - documents to remove from the index
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void deindexDocuments(IUriList uris)
throws WcmException,
ResourceException
uris - list of URI objects
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void deindexDocuments(IRidList rids)
throws WcmException,
ResourceException
rids - resource IDs to remove from the index
where every RID represents a document
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void deindexDocument(IResource resource)
throws WcmException,
ResourceException
resource - document to remove from the index
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void deindexDocument(URI uri)
throws WcmException,
ResourceException
uri - URI to deindex
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void deindexDocument(RID rid)
throws WcmException,
ResourceException
rid - resource ID as reference to a document to remove from the index
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation
void delete()
throws WcmException
deleted(IResourceContext)
deleteIndex(IIndex)
method of the IIndexService interface should be used
instead of this. It deletes the index on cm side after internally calling this
delete() method of the index to delete the index physically.
Example:
String indexId = "abc"; IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IIndex index = indexService.getIndex(indexId); indexService.deleteIndex(index);
WcmException - exception raised in failure situation
IndexDoesNotExistOnServerException - raised if the index could not
be deleted physically because it does not exist any more but could successfully
be deleted on CM side.
void delete(IResourceContext context)
throws WcmException
deleteIndex(IIndex)
method of the IIndexService interface should be used
instead of this. It deletes the index on cm side after internally calling this
delete() method of the index to delete the index physically.
Example:
String indexId = "abc"; IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IIndex index = indexService.getIndex(indexId); indexService.deleteIndex(index);
context - user context
WcmException - exception raised in failure situation
IndexDoesNotExistOnServerException - raised if the index could not
be deleted physically because it does not exist any more but could be successfully
deleted on CM side.
void clear()
throws WcmException
reindex() method does exactly this. It first calls the
clear() method to initialise the index and then starts
indexing all index folders that are attached to the index.
WcmException - exception raised in failure situation
void deleteOnServer()
throws WcmException
WcmException
void createIndexOnServer()
throws WcmException
WcmExceptionvoid init(Properties indexProperties)
generate() method.
Example:
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.createIndex(indexId, indexName, indexGroup, serviceId);
Properties customProperties = new Properties();
customProperties.put("propertyXY","valueXY");
index.init(customProperties);
index.generate();
As an example of an index specific property, a TrexSearchIndex
has the property "fuzziness" that can have values from "0.0" to "1.0".TrexSearchIndex class itself
because the property is not a generic index property.
indexProperties - property bag that contains index implementation specific propertiesvoid setProperties(Properties indexProperties)
Example:
String indexId = "abc";
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.getIndex(indexId);
Properties customProperties = new Properties();
customProperties.put("propertyXY","valueXY");
index.setProperties(customProperties);
As an example of an index specific property, a TrexSearchIndex
has the property "fuzziness" that can have values from "0.0" to "1.0".TrexSearchIndex class itself
because the property is not a generic index property.
indexProperties - property bag that contains index implementation specific propertiesProperties getProperties()
setProperties.
void checkProperties(Properties customProperties)
throws WcmException
customProperties -
WcmException
void generate()
throws WcmException
generate(IResourceContext)
Example:
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.createIndex(indexId, indexName, indexGroup, serviceId);
Properties customProperties = new Properties();
customProperties.put("propertyXY","valueXY");
index.init(customProperties);
index.generate();
WcmException - exception raised in failure situation
void generate(IResourceContext context)
throws WcmException
Example:
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.createIndex(indexId, indexName, indexGroup, serviceId);
Properties customProperties = new Properties();
customProperties.put("propertyXY","valueXY");
index.init(customProperties);
index.generate();
context - user context
WcmException - exception raised in failure situation
void reindex()
throws WcmException
clear() method) and starts putting all
documents into the index again
WcmException - exception raised in failure situation
void reindex(boolean disablePostClearTasks)
throws WcmException
clear() method) and starts putting all
documents into the index again
disablePostClearTasks - if true, the tasks that can be performed by
the index implementation after the index has been cleared are skipped.WcmException - exception raised in failure situation
void deltaReindex()
throws WcmException
reindex method, this call does not clear the index.
WcmException - exception raised in failure situationISupportedOptionSet getSupportedOptions()
ISearchIndex, IClassificationIndex)
that are supported by the index implementation.
Example:
String indexId = "abc";
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IIndex index = indexService.getIndex(indexId);
ISupportedOptionSet supportedOptions = index.getSupportedOptions();
if (supportedOptions.isSupported(SupportedOption.SEARCH)) {
//do search; it is supported by the index
}
SupportedOption
List getLanguagesOfIndexedDocuments()
throws WcmException
WcmExceptionIIndexFolder getIndexFolderForDocument(RID documentRid)
null is returned.
documentRid - resource ID of the document to get the index folder for
String getResourceInfo(IResource resource)
throws ResourceException
resource is null.
resource - resource to investigate
ResourceException - exception raised in failure situation
void setSchedulerTimeTable(ISchedulerTimeTable schedulerTimeTable)
throws WcmException
ISchedulerTimeTable. Thereby it sets this schedule for all
data sources with no own schedule.
Remark: It is recommended to use the similar method of the
IIndexService instead of this method.
schedulerTimeTable - ISchedulerTimeTable
WcmException - in case of an error.
ISchedulerTimeTable getSchedulerTimeTable()
throws WcmException
IIndexService instead of this method.
ISchedulerTimeTable
WcmException - in case of an error.boolean isActive()
boolean setActive(boolean isActive)
throws WcmException
isActive - if index should be set to active, false if index should be deactivated
WcmException - in case of an error.
void setActiveDuringStartup(boolean isActive)
throws WcmException
isActive -
WcmException
void setInactiveIndexHasChanged()
throws WcmException,
ResourceException
WcmException - in case of an error
ResourceException - in case of an error
RID getRID()
throws WcmException
WcmException - in case of an error.
void setStateAndNumberOfCrawler(AbstractIndex.IndexingState state,
int numOfCrawler)
throws WcmException
state - numOfCrawler -
WcmException
void setIndexingState(AbstractIndex.IndexingState state)
throws WcmException
state -
WcmException
AbstractIndex.IndexingState getIndexingState()
throws WcmException
WcmException
int reduceNumberOfCrawler()
throws WcmException
WcmExceptionboolean typeShouldBeIndexed(IResource resource)
resource -
String getWhatToIndexString()
void setWhatToIndex(String whatToIndex)
whatToIndex - boolean indexInternalLinks()
List getSimilarClasses(IPropertyName propName,
String value,
int maxResults)
throws WcmException
propName - value - maxResults -
WcmException
void changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyNameList deleteValues,
IProperty testProperty)
throws WcmException
rid - addProperties - deleteProperties - deleteValues - testProperty -
WcmException
void changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyNameList deleteValues,
boolean testQueue)
throws WcmException
rid - addProperties - deleteProperties - deleteValues - testQueue -
WcmException
List changeIndexedDocumentProperties(RID rid,
IPropertyMap addProperties,
IPropertyMap deleteProperties,
IPropertyMap defineProperties)
throws NotSupportedException
rid - RID of the resourceaddProperties - Properties which should added to the resourcedeleteProperties - Properties which should deleted from the resourcedefineProperties - Properties for which the definition has to be send to the server first, because until now no
indexed document already contains it
NotSupportedException
void deindex(IQueryEntryList query)
throws WcmException
query -
WcmException| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
|
SAP NetWeaver 7.40 SP 06 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||