OpenWGA 7.2 - TMLScript reference

Lucene
Method :

getFieldIndexType(name)

On object Lucene
Usage Returns the FieldIndexType for a specific field name
Description

Use this method to find out about the lucene index configuration for a specific item name. It will lookup the lucene indexing rule that matches the given item name and returns its information as FieldIndexType object. 

The lucene rules used are those from the OpenWGA application that the current Lucene object has in context.

Parameters

name (String):

Item name

Return value FieldIndexType object
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Finding out if an item of name "state" would be indexed "sortable".  Note that the rule defining this index type does not need to match the item name completely. It may be a rule which only matches the item name beginning or the default rule:

if (WGA.lucene().getFieldIndexType("state").sortable) {

  options = "sort:state(asc)"

}

else {

  options = "sort:LASTMODIFIED(asc)"

}