Hi,
Stefan Menten wrote:
>
[..]
> If an index is build or changed after data is inserted into a global,
> the index is not updated automaticly.
>
> Is there a way, to do this?
In a sense. We provide two %Persistent class methods that can help you :
..%PurgeIndices($lb([<IndexName1>[,<IndexName2>[,..]]]))
..%BuildIndices($lb([<IndexName1>[,<IndexName2>[,..]]]))
If you want to change something pertinent to the index it is a good
practice to purge the index entries prior to the change. If you change
the name of the index ('indexOnTitlesSoundex' -> 'indexOnTitlesPhonex')
it is a must, otherwise the purge cannot apply to a non-existent
(according to the modified repository) index.
Example :
#; that will remove _all_ the index entries as defined in
'indexOnTitlesSoundex'
do ##class(Artist).%PurgeIndices($lb("indexOnTitlesSoundex"))
[... do what you got to do & recompile class ...]
#; that will create the new index entries according to your new/modifed
definition
do ##class(Artist).%BuildIndices($lb("indexOnTitlesSoundex"))
#; or (in case you built a new one with a new name ...)
do ##class(Artist).%BuildIndices($lb("indexOnTitlesPhonex"))
Hope that helps
Gerd Nachtsheim
--
Gerd Nachtsheim, Sales Engineer
InterSystems GmbH
Tel. +49 (0)6151 1747-0, Fax -11
mailto:[EMAIL PROTECTED]
http://www.intersystems.de