Enhancement
Critical
Major
Detail
Detail
There is no dependency between Lucene and the tl:BookmarkService. This may cause the modules to be started in the wrong order. When Lucene indexes the page, it queries the text of the page. This in turn triggers a routine where TLObjectLinks in the tl:I18NStructuredText are updated if their name has changed. If the tl:BookmarkService is started after Lucene this will lead to errors.
java.lang.IllegalStateException: com.top_logic.tool.boundsec.commandhandlers.BookmarkService module not started. at com.top_logic.basic.module.ModuleUtil.invalidStateNotStarted(ModuleUtil.java:1014) at com.top_logic.basic.module.BasicRuntimeModule.getImplementationInstance(BasicRuntimeModule.java:86) at com.top_logic.tool.boundsec.commandhandlers.BookmarkService.getInstance(BookmarkService.java:181) at com.top_logic.tool.boundsec.commandhandlers.DefaultBookmarkHandler.getObject(DefaultBookmarkHandler.java:64) at com.top_logic.tool.boundsec.commandhandlers.DefaultBookmarkHandler.getBookmarkObject(DefaultBookmarkHandler.java:59) at com.top_logic.layout.wysiwyg.ui.TLObjectLinkUtil.getObject(TLObjectLinkUtil.java:71) at com.top_logic.model.wysiwyg.i18n.I18NStructuredTextAttributeStorage.resolveLinkTaget(I18NStructuredTextAttributeStorage.java:210) at com.top_logic.model.wysiwyg.i18n.I18NStructuredTextAttributeStorage.updateLinks(I18NStructuredTextAttributeStorage.java:235) at com.top_logic.model.wysiwyg.i18n.I18NStructuredTextAttributeStorage.addSourceCodes(I18NStructuredTextAttributeStorage.java:100) at com.top_logic.model.wysiwyg.i18n.I18NStructuredTextAttributeStorage.getAttributeValue(I18NStructuredTextAttributeStorage.java:91) at com.top_logic.element.meta.AttributeOperations.getAttributeValue(AttributeOperations.java:215) at com.top_logic.element.meta.kbbased.PersistentObjectImpl.getValue(PersistentObjectImpl.java:154) at com.top_logic.element.meta.kbbased.PersistentObjectImpl.generateFullText(PersistentObjectImpl.java:286) at com.top_logic.element.structured.wrap.AttributedStructuredElementWrapper.generateFullText(AttributedStructuredElementWrapper.java:119) at com.top_logic.knowledge.indexing.DefaultIndexingService$WrapperContentObject.getContent(DefaultIndexingService.java:451) at com.top_logic.knowledge.indexing.lucene.LuceneThread.getContent(LuceneThread.java:491)
Also, Lucene does not properly create indexes when the application starts. While Lucene detects if there are none and they need to be recreated, it only creates empty indexes, so to speak, in the process. The actual objects to be indexed are ignored.
Another problem is that while you can currently remove tables via config: {{#!xml <declaration resource="webinf://kbase/GovernedObjectMeta.xml" config:operation="remove" /> }} This does not work for configured indexes yet, because it is a ListBinding which does not support such operations yet.
Improvement
Since a dependency between the modules is not very useful, it is now checked if the tl:BookmarkService is already started when updating the links. If not, no links have to be updated. This is done at the latest when the page with the links is opened and the tl:BookmarkService is already started anyway.
Also there is now a flag in tl:LuceneIndex that stores if a new Lucene index had to be created. The tl:LuceneIndexingService then uses this to start a rebuild of all indexes.
To also allow the removal of indexes, the tl:AbstractListBining and tl:MapAttributeBinding have been extended to allow operations in the configuration similar to the tl:ConfigurationReader. Which operations are possible can be seen here: doc:StackedConfiguration
Application of the configuration operations
An example of how to remove an index again: {{#!xml <config service-class="com.top_logic.knowledge.indexing.DefaultIndexingService" >
<instance>
<meta-objects>
<meta-object value="DecisionMemo" config:operation="remove"/>
</meta-objects>
</instance>
</config> }}
Test
- Start a tl-doc application and create pages in the documentation.
- Stop the application and then delete the lucene_index folder in /com.top_logic.doc.app/tmp/app-data/var.
- Restart the application
- Enter a valid search in the search bar. Appropriate results should appear.
Also, more tests for the operations in List and MapBindings:
- TestMapAttributeBinding.java
- TestListBinding.java