OpenWGA 7.0 - TMLScript reference
LuceneMethod :
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 | A FileIndexType object |
Allowed in script types |
|
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; } |