OpenWGA 7.0 - TMLScript reference

Lucene
Method :

getFileIndexType(name)

On object Lucene
Usage Returns the FileIndexType for a specific file name
Description

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

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

Parameters

name (String):

File name

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

Finding out if a content attachment file of name "abstract.pdf" would be indexed for "all content" queries, so its contents will be found in field-unspecific searches. Note that the rule defining this index type does not need to match the file name completely. It may be a rule which only matches the file name beginning or the default rule:

if (WGA.lucene().getFileIndexType("abstract.pdf").includedInAllContent) {

  query += searchTerm;

}

else {

  query += "allattachments:" + searchTerm;

}