OpenWGA 7.10 - TMLScript reference


Object:

Lucene

Description

The "Lucene" object provides functionalities related to fulltext search in TMLScript.

Each Lucene object is constructed with an application in context which determines a context for all lucene operations. Additionally TMLContext may be given which provides the necessary context for operations that refer to previously ran queries, like Lucene.bestFragments()Lucene.highlightItem() and Lucene.highlightMeta().

Retrieval

WGA.lucene()

App.lucene()

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Properties and methods
Name Purpose
bestFileFragments(fragmentSize, maxFragments, [String prefix, [String suffix, [String encode])]] Returns those parts of a files contents that matched a lucene search
bestFragments(itemname, fragmentSize, maxFragments [, prefix] [, suffix] [, encode]) Returns those parts of an items value that matched a lucene search
getFieldIndexType(name) Returns the FieldIndexType for a specific field name
highlightItem(name, prefix, suffix [, encode]) Returns an item of the current context document, highlighting found terms of the last lucene search
highlightMeta(name, prefix, suffix [, encode]) Returns a metadata field of the current context document, highlighting found terms of the last lucene search
removeQuery() Removes the data of the last lucene query with activated result highlighting from the users session
updateIndex() Run lucene index update immediately