Class FinderIndexerHelper

Description

Helper class for the Finder indexer package.

  • since: 2.5

Located in /administrator/components/com_finder/helpers/indexer/helper.php (line 23)


	
			
Variable Summary
Method Summary
 static integer addContentType (string $title, [string $mime = null])
 static array getCommonWords (string $lang)
 static boolean getContentExtras (FinderIndexerResult &$item)
 static string getContentPath (string $url)
 static string getDefaultLanguage ()
 static string getPrimaryLanguage (string $lang)
 static boolean isCommon (string $token, string $lang)
 static string parse (string $input, [string $format = 'html'])
 static string prepareContent (string $text, [JRegistry $params = null])
 static string stem (string $token, string $lang)
 static array tokenize (string $input, string $lang, [boolean $phrase = false])
Variables
static FinderIndexerStemmer $stemmer (line 32)

The token stemmer object. The stemmer is set by whatever class wishes to use it but it must be an instance of FinderIndexerStemmer.

  • since: 2.5
  • access: public
Methods
static addContentType (line 246)

Method to add a content type to the database.

  • return: The id of the content type.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static integer addContentType (string $title, [string $mime = null])
  • string $title: The type of content. For example: PDF
  • string $mime: The mime type of the content. For example: PDF [optional]
static getCommonWords (line 324)

Method to get an array of common terms for a language.

  • return: Array of common terms.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static array getCommonWords (string $lang)
  • string $lang: The language to use.
static getContentExtras (line 433)

Method to get extra data for a content before being indexed. This is how we add Comments, Tags, Labels, etc. that should be available to Finder.

  • return: True on success, false on failure.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static boolean getContentExtras (FinderIndexerResult &$item)
static getContentPath (line 401)

Method to get the path (SEF route) for a content item.

  • return: The path for the content item.
  • since: 2.5
  • access: public
static string getContentPath (string $url)
  • string $url: The non-SEF route to the content item.
static getDefaultLanguage (line 348)

Method to get the default language for the site.

  • return: The default language string.
  • since: 2.5
  • access: public
static string getDefaultLanguage ()
static getPrimaryLanguage (line 370)

Method to parse a language/locale key and return a simple language string.

  • return: The simple language string. For example: en
  • since: 2.5
  • access: public
static string getPrimaryLanguage (string $lang)
  • string $lang: The language/locale key. For example: en-GB
static isCommon (line 293)

Method to check if a token is common in a language.

  • return: True if common, false otherwise.
  • since: 2.5
  • access: public
static boolean isCommon (string $token, string $lang)
  • string $token: The token to test.
  • string $lang: The language to reference.
static parse (line 45)

Method to parse input into plain text.

  • return: The parsed input.
  • throws: Exception on invalid parser.
  • since: 2.5
  • access: public
static string parse (string $input, [string $format = 'html'])
  • string $input: The raw input.
  • string $format: The format of the input. [optional]
static prepareContent (line 472)

Method to process content text using the onContentPrepare event trigger.

  • return: The processed content.
  • since: 2.5
  • access: public
static string prepareContent (string $text, [JRegistry $params = null])
  • string $text: The content to process.
  • JRegistry $params: The parameters object. [optional]
static stem (line 213)

Method to get the base word of a token. This method uses the public FinderIndexerHelper::$stemmer object if it is set. If no stemmer is set, the original token is returned.

  • return: The root token.
  • since: 2.5
  • access: public
static string stem (string $token, string $lang)
  • string $token: The token to stem.
  • string $lang: The language of the token.
static tokenize (line 62)

Method to tokenize a text string.

  • return: An array of FinderIndexerToken objects.
  • since: 2.5
  • access: public
static array tokenize (string $input, string $lang, [boolean $phrase = false])
  • string $input: The input to tokenize.
  • string $lang: The language of the input.
  • boolean $phrase: Flag to indicate whether input could be a phrase. [optional]

Documentation generated on Tue, 19 Nov 2013 15:04:20 +0100 by phpDocumentor 1.4.3