com.sapportals.wcm.service.indexmanagement

Interface IIndex

All Known Subinterfaces:
IClassificationIndex, ISearchIndex
All Known Implementing Classes:
AbstractClassificationIndex, AbstractIndex

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

See Also:
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

getIndexedProperties

IPropertyMap getIndexedProperties()
                                  throws WcmException
Returns the properties, indexed with the documents in the index. Only the information about the properties not all their values are returned, i.e. each property appearch only one time in the return map.

Returns:
Map with the properties
Throws:
WcmException - Exception raised in failure situation

getIndexId

String getIndexId()
Identifies the index within the system.
The ID of an index is needed to get the IIndex object from the IIndexService.
Forbidden characters for an index ID are dot('.'), space(' ') and plus('+').

Returns:
ID of the index as a String

getIndexName

String getIndexName()
Non-technical identifier of an index.
The index name should be used for display purposes only.
All characters are allowed for an index name. If no index name is available, the index ID is returned.

Returns:
display name of the index

addFolderUri

void addFolderUri(URI folderUri)
Deprecated. as of NW04. Use add(IIndexFolder) at the IIndexFolderList interface

For internal use.

Parameters:
folderUri - FolderUri to be added

getFolderUris

IUriList getFolderUris()
Deprecated. as of NW04. Use getIndexFolders()

Returns:
list of URI objects that represent the attached folders of the index

getIndexFolders

IIndexFolderList getIndexFolders()
Folders or start pages that are assigned to the index for indexing.
A document is added to a particular index, if a superior folder (or startpage) is contained in IIndexFolderList. If more than one superior folder is attached to different indexes, the lower folder determines the index, in which the document is stored.

Returns:
list of IIndexFolder objects that represent the attached folders of the index

getServiceId

String getServiceId()
Specifies the index implementation that is used for the index.
Every service ID is linked to a java class from which the index object is instantiated.
The index implementation determines the interfaces that can be used for the index.
Additionally, the service types of the index are determined by the implementation.
Example:
Service ID: trexSearchAndClassification
Java Class: com.sapportals.wcm.service.indexmanagement.retrieval.trex.TrexSearchAndClassificationIndex
Additional interfaces: ISearchIndex, IClassificationIndex
Service types: search, classification

Returns:
identifier of the index service as a String

getIndexGroup

String getIndexGroup()
Returns the group of indexes to which the index logically belongs.
Grouping indexes makes it possible to perform operations on more than one index by selecting an index group and performing the action on all indexes in that group.
These cumulative functions must be implemented on UI level. Currently this is implemented in the CM search dialog box for the selection of indexes. Selection is carried out by selecting an index group to search in all indexes that belong to that group. group can be null.

Returns:
group the index has been assigned to

getServiceTypes

List getServiceTypes()
Determines the kind of index
A document can only be indexed into one index of an particular service type.
Examples of service types are "search" and "classification".

Returns:
list of service types of the index as String
Service types are available as constants of the interface IWcmIndexConst starting with "SERVICE_TYPE_".

getServiceTypes

List getServiceTypes(Locale locale)
Displays representations of the indexes service types in the locale's language.
The returned types should only be used for display purposes.

Parameters:
locale - local in which the service type names have to be returned
Returns:
list of service types of the index as String in the locale's language

getCrawlerProfileId

String getCrawlerProfileId()
ID of the default crawler profile for all index folders of the index.

Returns:
crawler profile ID

removeAllFolderUris

void removeAllFolderUris()
Deprecated. as of NW04. Use clear() at the IIndexFolderList interface

For internal use


removeFolderUri

void removeFolderUri(URI folderUri)
Deprecated. as of NW04. Use remove(IIndexFolder) at the IIndexFolderList interface

For internal use

Parameters:
folderUri - URI of the folder to remove from the index

setIndexName

void setIndexName(String indexName)
Non-technical identifier of an index.
The index name should be used for display purposes only.
All characters are allowed for an index name.

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);
 

Parameters:
indexName - display name of the index

setIndexGroup

void setIndexGroup(String indexGroup)
Assigns the index to a group of indexes that logically belong together.
Grouping indexes makes it possible to perform operations on more than one index by selecting an index group and performing the action on all indexes of that group.
These cumulative functions must be implemented on UI level. Currently this is implemented in the CM search dialog for the selection of indexes. Selection is done by just selecting an index group to search in all indexes that belong to that group.

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);
 

Parameters:
indexGroup - group the index has to been assigned to

setCrawlerProfileId

void setCrawlerProfileId(String crawlerProfileId)
                         throws WcmException
Sets the ID of the default crawler profile for all index folders of the index.

Parameters:
crawlerProfileId - The new CrawlerProfileId value
Throws:
WcmException - WcmException if the operation fails

indexDocuments

void indexDocuments(IResourceList resources)
                    throws ResourceException,
                           WcmException,
                           IOException
Puts a list of documents into the index.
It is recommended that you do not index documents manually using this method.
In case of repositories that are sending cm events, documents are indexed automatically when their content or their properties are changed.
In case of repositories that are not supporting eventing, e.g. web repositories, a delta index crawler should be scheduled for the index folders that need to be updated.

Parameters:
resources - documents to index as IResourceList
Throws:
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation

indexDocuments

void indexDocuments(IResourceList resources,
                    IResourceEvent resourceEvent)
                    throws ResourceException,
                           WcmException,
                           IOException
Puts a list of documents into the index.
It is recommended that you do not index documents manually using this method.
For repositories that send cm events, documents are indexed automatically when their content or their properties are changed.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated.

Parameters:
resources - documents to index as IResourceList
resourceEvent - event that caused the index request
Throws:
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation

indexDocument

void indexDocument(IResource resource)
                   throws ResourceException,
                          WcmException,
                          IOException
Puts a document into the index.
It is recommended that you do not index documents manually using this method.
For repositories that send cm events, documents are indexed automatically when their content or their properties are changed.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated.

Parameters:
resource - document to index
Throws:
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation

indexDocument

void indexDocument(IResource resource,
                   IResourceEvent resourceEvent)
                   throws ResourceException,
                          WcmException,
                          IOException
Puts a document into the index
It is recommended that you do not index documents manually using this method.
For repositories that send cm events, documents are indexed automatically when their content or their properties are changed.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated.

Parameters:
resource - document to index
resourceEvent -
Throws:
ResourceException - exception raised in failure situation
WcmException - exception raised in failure situation
IOException - exception raised in failure situation

deindexDocuments

void deindexDocuments(IResourceList resources)
                      throws WcmException,
                             ResourceException
Removes a list of documents from the index
It is recommended that you do not deindex documents manually using this method.
For repositories that send cm events, documents are deindexed automatically when they are deleted.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated. The crawler deindexes documents that have been deleted since the last crawl.

Parameters:
resources - documents to remove from the index
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

deindexDocuments

void deindexDocuments(IUriList uris)
                      throws WcmException,
                             ResourceException
Deprecated. as of NW04. Use deindex documents(IRidList)

Deindexes documents.

Parameters:
uris - list of URI objects
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

deindexDocuments

void deindexDocuments(IRidList rids)
                      throws WcmException,
                             ResourceException
Removes a list of documents from the index
It is recommended that you do not deindex documents manually using this method.
For repositories that send cm events, documents are deindexed automatically when they are deleted.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated. The crawler deindexes documents that have been deleted since the last crawl.

Parameters:
rids - resource IDs to remove from the index where every RID represents a document
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

deindexDocument

void deindexDocument(IResource resource)
                     throws WcmException,
                            ResourceException
Removes a document from the index.
It is recommended that you do not deindex documents manually using this method.
For repositories that send cm events, documents are deindexed automatically when they are deleted.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated. The crawler deindexes documents that have been deleted since the last crawl.

Parameters:
resource - document to remove from the index
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

deindexDocument

void deindexDocument(URI uri)
                     throws WcmException,
                            ResourceException
Deprecated. as of NW04. Use deindexDocument(RID)

Deindexes a URI (method for internal use)

Parameters:
uri - URI to deindex
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

deindexDocument

void deindexDocument(RID rid)
                     throws WcmException,
                            ResourceException
Removes a document from the index.
It is recommended that you do not deindex documents manually using this method.
For repositories that send cm events, documents are deindexed automatically when they are deleted.
For repositories that do not support eventing, for example, Web repositories, a delta index crawler should be scheduled for the index folders that need to be updated. The crawler deindexes documents that have been deleted since the last crawl.

Parameters:
rid - resource ID as reference to a document to remove from the index
Throws:
WcmException - exception raised in failure situation
ResourceException - exception raised in failure situation

delete

void delete()
            throws WcmException
Deprecated. as of NW04. Use deleted(IResourceContext)

Deletes the index physically.
Important: To delete an index, the 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);
 

Throws:
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.

delete

void delete(IResourceContext context)
            throws WcmException
Deletes the index physically
Important: To delete an index the 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);
 

Parameters:
context - user context
Throws:
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.

clear

void clear()
           throws WcmException
All documents are removed from the index and the index is set to an initial state.
The configuration for the index remains, but all documents must be indexed again.
Using the 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.

Throws:
WcmException - exception raised in failure situation

deleteOnServer

void deleteOnServer()
                    throws WcmException
Deletes the index on the index server connected with the CM system.

Throws:
WcmException

createIndexOnServer

void createIndexOnServer()
                         throws WcmException
Creates the index on the index server connected with the CM system.

Throws:
WcmException

init

void init(Properties indexProperties)
Initialises the index with data that is specific for an index implementation
The implementation is responsible for storing this data.
This method is called before calling the 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".
This property is stored by the TrexSearchIndex class itself because the property is not a generic index property.

Parameters:
indexProperties - property bag that contains index implementation specific properties

setProperties

void setProperties(Properties indexProperties)
Saves index data that is specific for an index implementation
The implementation is responsible for storing this data.

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".
This property is stored by the TrexSearchIndex class itself because the property is not a generic index property.

Parameters:
indexProperties - property bag that contains index implementation specific properties

getProperties

Properties getProperties()
These properties of the index are only the ones that are specific for an index implementation.
For more see setProperties.

Returns:
properties of the index

checkProperties

void checkProperties(Properties customProperties)
                     throws WcmException
With this method the properties that should be set could be checked. In case of a wrong property (range error, format error, etc.) a WcmException is thrown, with a localised error message, describing the problem. If the parameter is null, no exception is thrown.

Parameters:
customProperties -
Throws:
WcmException

generate

void generate()
              throws WcmException
Deprecated. as of NW04. Use generate(IResourceContext)

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.

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();
 

Throws:
WcmException - exception raised in failure situation

generate

void generate(IResourceContext context)
              throws WcmException
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.

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();
 

Parameters:
context - user context
Throws:
WcmException - exception raised in failure situation

reindex

void reindex()
             throws WcmException
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. This can be caused by configuration changes. If this is the case, the documents in the index are no longer accessible from CM and must be removed from the index. The documents of the new target repository also have to be indexed.

Throws:
WcmException - exception raised in failure situation

reindex

void reindex(boolean disablePostClearTasks)
             throws WcmException
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. This can be caused by configuration changes. If this is the case, the documents in the index are no longer accessible from CM and must be removed from the index. The documents of the new target repository also have to be indexed.

Parameters:
disablePostClearTasks - if true, the tasks that can be performed by the index implementation after the index has been cleared are skipped.
Example: Do not train the classification index before reindexing all documents.
Throws:
WcmException - exception raised in failure situation

deltaReindex

void deltaReindex()
                  throws WcmException
Performs indexing of the documents that are not yet indexed or have been changed since the last crawl.
Additionally, it deindexes documents from the index that were indexed but have since been deleted. In contrast to the reindex method, this call does not clear the index.

Throws:
WcmException - exception raised in failure situation

getSupportedOptions

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.

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
  }
 

Returns:
set of supported actions as SupportedOption

getLanguagesOfIndexedDocuments

List getLanguagesOfIndexedDocuments()
                                    throws WcmException
Returns the languages of an index, for which documents exist in.

Returns:
List of strings each describing one language.
Throws:
WcmException

getIndexFolderForDocument

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. If the document does not belong to the index, null is returned.

Parameters:
documentRid - resource ID of the document to get the index folder for
Returns:
index folder for the document

getResourceInfo

String getResourceInfo(IResource resource)
                       throws ResourceException
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. its service types. A NullPointerException is returned, if resource is null.

Parameters:
resource - resource to investigate
Returns:
description about the resource and the index
Throws:
ResourceException - exception raised in failure situation

setSchedulerTimeTable

void setSchedulerTimeTable(ISchedulerTimeTable schedulerTimeTable)
                           throws WcmException
Registers a schedule for delta index crawling for the index with the 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.

Parameters:
schedulerTimeTable - ISchedulerTimeTable
Throws:
WcmException - in case of an error.

getSchedulerTimeTable

ISchedulerTimeTable getSchedulerTimeTable()
                                          throws WcmException
Returns the timetable of a schedule for delta index crawling for the index. Returns null in case that no schedule is defined for the index. Remark: It is recommended to use the similar method of the IIndexService instead of this method.

Returns:
ISchedulerTimeTable
Throws:
WcmException - in case of an error.

isActive

boolean isActive()
Returns the information if an index is available or has be set inactive.

Returns:
true if index is active, false if index is inactive

setActive

boolean setActive(boolean isActive)
                  throws WcmException
Sets an index inactive or activates it.

Parameters:
isActive - if index should be set to active, false if index should be deactivated
Returns:
true, if index has to be actualised after activating it, otherwise false
Throws:
WcmException - in case of an error.

setActiveDuringStartup

void setActiveDuringStartup(boolean isActive)
                            throws WcmException
Only for internal usage

Parameters:
isActive -
Throws:
WcmException

setInactiveIndexHasChanged

void setInactiveIndexHasChanged()
                                throws WcmException,
                                       ResourceException
Sets a property on true, if index documents have changed during index was inactive. The property is automatically deleted, if the index is reactivated, but the method for index reactivation returns true in that case, indicating that the index should be updated.

Throws:
WcmException - in case of an error
ResourceException - in case of an error

getRID

RID getRID()
           throws WcmException
Gets the resource ID of the resource representation of this index. Can return null if no index management repository prefix is configured.

Returns:
resource ID of this index
Throws:
WcmException - in case of an error.

setStateAndNumberOfCrawler

void setStateAndNumberOfCrawler(AbstractIndex.IndexingState state,
                                int numOfCrawler)
                                throws WcmException
Only for internal usage

Parameters:
state -
numOfCrawler -
Throws:
WcmException

setIndexingState

void setIndexingState(AbstractIndex.IndexingState state)
                      throws WcmException
Only for internal usage

Parameters:
state -
Throws:
WcmException

getIndexingState

AbstractIndex.IndexingState getIndexingState()
                                             throws WcmException
Only for internal usage

Returns:
indexing state
Throws:
WcmException

reduceNumberOfCrawler

int reduceNumberOfCrawler()
                          throws WcmException
Only for internal usage

Returns:
current state of crawler
Throws:
WcmException

typeShouldBeIndexed

boolean typeShouldBeIndexed(IResource resource)
Checks if the type (collection, simple resource) should be indexed.

Parameters:
resource -
Returns:
boolean type

getWhatToIndexString

String getWhatToIndexString()
String version of what is indexed (collection, simple resource, both)

Returns:
what is indexed as string

setWhatToIndex

void setWhatToIndex(String whatToIndex)
Set what should be indexed (collections, simple resources or both)

Parameters:
whatToIndex -

indexInternalLinks

boolean indexInternalLinks()
Checks if internal links should be indexed.

Returns:
boolean type

getSimilarClasses

List getSimilarClasses(IPropertyName propName,
                       String value,
                       int maxResults)
                       throws WcmException
Parameters:
propName -
value -
maxResults -
Returns:
similar property values to the input value with respect to specified property. Only modelled and indexable properties indexed as strings could be used here.
Throws:
WcmException

changeIndexedDocumentProperties

void changeIndexedDocumentProperties(RID rid,
                                     IPropertyMap addProperties,
                                     IPropertyMap deleteProperties,
                                     IPropertyNameList deleteValues,
                                     IProperty testProperty)
                                     throws WcmException
This method adds and deletes property values for a particular resource on the index server. For Trex, this method could only be used for date, time stamp, integer attributes as well as attributes which are indexed as strings on the Trex server. If testProperty is set, i.e. not equal null, the method first checks if the resource with this property is already in the index. If not, the resource is reindexed completely and the method stops. If testProperty is null or if the resource with the property value testValue is in the index, the following steps are executed in that order: - All former property values of properties listed in deleteValues are deleted. This parameter might be null if nothing should be deleted completely. - The property values defined in deleteProperties are deleted from the indexed resource. - The property values defined in addProperties are added to the indexed resource.

Parameters:
rid -
addProperties -
deleteProperties -
deleteValues -
testProperty -
Throws:
WcmException

changeIndexedDocumentProperties

void changeIndexedDocumentProperties(RID rid,
                                     IPropertyMap addProperties,
                                     IPropertyMap deleteProperties,
                                     IPropertyNameList deleteValues,
                                     boolean testQueue)
                                     throws WcmException
This method adds and deletes property values for a particular resource on the index server. For Trex, this method could only be used for date, time stamp, integer attributes as well as attributes which are indexed as strings on the Trex server. If testQueue is set on true, the method first checks if the resource with this property is already in the index by checking the index queue. If not, the resource is reindexed completely and the method stops. If testProperty is false or if the resource is in the index according to the queue information, the following steps are executed in that order: - All former property values of properties listed in deleteValues are deleted. This parameter might be null if nothing should be deleted completely. - The property values defined in deleteProperties are deleted from the indexed resource. - The property values defined in addProperties are added to the indexed resource.

Parameters:
rid -
addProperties -
deleteProperties -
deleteValues -
testQueue -
Throws:
WcmException

changeIndexedDocumentProperties

List changeIndexedDocumentProperties(RID rid,
                                     IPropertyMap addProperties,
                                     IPropertyMap deleteProperties,
                                     IPropertyMap defineProperties)
                                     throws NotSupportedException
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. For Trex, this method could only be used for date, time stamp, integer attributes as well as attributes which are indexed as strings on the Trex server.

Parameters:
rid - RID of the resource
addProperties - Properties which should added to the resource
deleteProperties - Properties which should deleted from the resource
defineProperties - Properties for which the definition has to be send to the server first, because until now no indexed document already contains it
Throws:
NotSupportedException

deindex

void deindex(IQueryEntryList query)
             throws WcmException
This method deindexes all resources from the index server fullfilling the query.

Parameters:
query -
Throws:
WcmException
Access Rights

This class can be accessed from:


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


Copyright 2014 SAP AG Complete Copyright Notice