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 .

Endpoint
Name:TextSearch
Description:search for text in a lucene index
Id:TextSearch
Category:accessor
Identifier Syntax

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

Base
active:textSearch

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

ArgumentRulesTypingDescription
operand
Mandatory
Representation (java.lang.Object)search query
config
Optional
Identifieroptional configuration
directory
Optional
Identifierfilesystem location of index
limit
Optional
Identifiermaximum number of results
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

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

This accessor throws no documented exceptions.

Import Requirements

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

<import>
  <uri>urn:org:netkernel:text:search:core</uri>
</import>

Query the search index with a search query.

An HDS/XML document contain any hits along with a summary of timing is returned as the response. This response has an expiry function attached such that if any changes are made to the index the search result is invalidated.

<hits xmlns:hds="http://netkernel.org/hds">
  <time hds:type="DOUBLE">0.0020</time>
  <total hds:type="INTEGER">1</total>
  <hit>
    <score hds:type="STRING">0.8466</score>
    <field>
      <name hds:type="STRING">SomeKey</name>
      <value hds:type="STRING">Some Value that will be stored but try searching for netkernel</value>
    </field>
    <field>
      <name hds:type="STRING">documentURI</name>
      <value hds:type="STRING">res:/test/docs/doc1.txt</value>
    </field>
    <field>
      <name hds:type="STRING">keywords</name>
      <value hds:type="STRING">this field is indexed</value>
    </field>
  </hit>
</hits>

operand argument

The operand should be a org.apache.lucene.search.Query.

default string query parser

If the operand is a String then the default query parser transreptor will parse the string to a Query object using the standard Lucene query syntax.

If no field is specified then the default field default will be used.

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.

limit argument

Set the maximum number of search results to return. This is a literal identifier value - the limit argument is parsed to be an integer. If not set the default is 100 hits.