WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Description:add a search result into a lucene index
Identifier Syntax

TextIndex is an accessor using Active URI syntax with the following base identifiers:


and the following arguments: (for more details on argument passing details see here)

Representation (java.lang.Object)specification of item to index
Identifieroptional configuration
Identifierfilesystem location of index
Request Verbs

The following verb is supported:


The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use TextIndex accessor you must import the module urn:org:netkernel:text:search:core:


Adds a single item with one or more fields to the index.

The endpoint returns back an XML document summarizing time taken in seconds and number of items added:


operand argument

The declarative index specification of the resource to be analyzed and/or added to the indexed. It consists of an item containing fields.


An item to be be indexed has the following form.

  <field index="ANALYZED" store="NO">
  <field index="ANALYZED" store="YES">
    <value>this field is indexed</value>
  </field> ...any number of fields...

An item may contain any number of field entries. The format for a field must be as follows...

<field index="...an indexing option..." store="...a storage option...">
  <name>the Lucene index field name</name>
  <uri>URI of resource to index</uri> or
  <value>a text string value to index</value>

A field must specify a name - this is the Lucene index field name under which the item will be categorized in the indexed and is the identity used for targeting searches.

A field must specify one of uri or value.

  • uri - is the URI of the resource to be indexed. It will be read as a IReadableBinaryStream and will be analyzed but will not be stored. If this option is specified then the item will be added to the index with an accompanying index field with name "[ name ] URI" containing the value of uri.
  • value is a text string to be indexed.

index attribute

The index attribute options are capitalized strings and must be valid static fields on the Lucene Field.Index object.

For example

  • index="ANALYZED" - Index the tokens produced by running the field's value through the Analyzer.
  • index="NOT_ANALYZED" - Index the field's value without using an Analyzer, so it can be searched. As no analyzer is used the value will be stored as a single term. This is useful for unique Ids like product numbers.
  • index="NO" - Field is not indexed

If index is ommitted from a field the default is "ANALYZED".

store attribute

store attribute options are capitalized strings and must be valid static fields on the Lucene Field.Store object.

For example

  • store="NO" - do not store the content in the index.
  • store="YES" - store the content in the index to be returned with search hits.

If store ommitted from a field the default is "NO".

directory argument

An optional URI to the directory containing the Lucene index. If not specified the index directory will be taken from the configuration

config argument

An optional reference to the configuration to use. If not specified then the tools look for a local configuration resource located at res:/etc/SearchConfig.xml. If this is not found a default configuration is used.