Property |
Values |
Default Value |
FullTextIndex |
on, off
enables the full text index engine. With default configuration, full text indexes for all ontologies are automatically generated and can be used with the _queryIndex/10 builtin. |
on |
FullTextIndex.ChangeLogInRam |
on, off Advanced configuration option to disable persistent change log if a persistent datamodel (i.e. H2) is used. Has no meaning when using a RAM datamodel |
on |
FullTextIndex.Directory |
Directory to use for storing the full text index files. |
index |
FullTextIndex.NoIndexBuilding |
on, off By default it is off (and OntoBroker's behaviour is unchanged). If it is turned on, OntoBroker does not build or updates any indexes, but can still use the FullTextIndex infrastructure (inclusive searching indices) |
off |
FullTextIndex.WaitOnStartup |
on, off If this switch is turned on, the server waits for the end of the indexing on startup, before any queries and commands are executed. Please note, that this does not apply to direct access to the KAON2 API via the OntologyManager. |
off |
FullTextIndex.ReuseOnRestart |
on, off If this switch is on and the OntoBroker runs with a RAM datamodel (Storage = RAM.Choose, etc), then the index file are reused on OntoBroker restart if the ontology files are the same as during the creation of the index. |
off |
The indexer can now be customized with additional fields. Values for a defined set of attributes can be added to additional Lucene index fields and then used with the _queryIndex/10 built-in or for autocompletion.
OntoBroker automatically builds an index with several predefined fields (e.g. id, name_de, name_en, all, ...) for all ontology objects if the OntoConfig.prp parameter "Indexer" is set to "on".To customize this index, you have to adapt the configuration file "indexer-context.xml" located in the configuration directory (defaults to ./conf relative to the working directory). There you can define custom index fields for the bean with the id "ObjectLogicDocumentBuilder".
Examples and Scenarios
Scenario for "FullTextIndex.WaitOnStartup":
The full text indexes are always generated and updated asynchronously in the background. If it is important that the full text index are complete directly after the start of OntoBroker, turn FullTextIndex.WaitOnStartup=on. In this case the OntoBroker waits for completion of index generation on startup before it executes any command or queries.
Scenario for "FullTextIndex.ReuseOnRestart":
If OntoBroker runs in a read-only mode, e.g. OntoBroker only loads some ontologies on startup and then the ontologies are not changed anymore (at least without saving them), this option can be used to improve startup time. If the full text indexes have already been generated, OntoBroker will them reuse them on a restart without rebuilding them.
Configuration example
...
<bean id="ObjectLogicDocumentBuilder" class="com.ontoprise.indexer.flogic.ObjectLogicStandardObjectDocumentBuilder">
...
<property name="customIndexFields">
<list>
<bean class="com.ontoprise.indexer.objectlogic.CustomIndexField">
<property name="fieldName" value="xname" />
<property name="stored" value="true" />
<property name="attributeNames">
<set>
<value><http://my.name.space#secondary%20name></value>
<value><http://my.name.space#Label></value>
</set>
</property>
</bean>
</list>
</property>
</bean>
...
In this example, one custom index field with the name "xname" is defined. The values are stored in the index for retrieval (this is only needed if it is used for autocompletion or if you want to use the return() option of the _queryIndex built-in). All values of the attributes <http://my.name.space#secondary%20name> and <http://my.name.space#Label> are indexed for any ontology object containing such an attribute.
Search Example
To search in this field with _queryIndex/10, use the Lucene syntax for fields (here "xname:") in front of your search text.
?- _queryIndex(<http://your.company.com#ontology>, [return(xname)], "xname:Transp*", 0, 10, ?OBJ, ?TC, ?SCORE, ?ORDER, ?OPT).
Autocomplete Example
For autocomplete you have to set the search field in the AutoComplete
AutocompleteHelper helper = ...
Ontology ontology = ...
AutocompleteHelper.Type type = ...
AutocompleteHelper.Options options = new AutocompleteHelper.Options();
options.setSearchField("xname");
options.set...
CompletionResults results = helper.getCompletion(ontology, options, type, "Transp", 0, 10);
...