Text Search Objects

The textsearch module defines eight classes: classes TSConfiguration, TSDictionary, TSParser and TSTemplate derived from DbSchemaObject, and classes TSConfigurationDict, TSDictionaryDict, TSParserDict and TSTemplateDict derived from DbObjectDict.

Text Search Configuration

TSConfiguration is derived from DbSchemaObject and represents a PostgreSQL text search configuration.

class pyrseas.dbobject.textsearch.TSConfiguration(**attrs)

A text search configuration definition

TSConfiguration.to_map(no_owner)

Convert a text search configuration to a YAML-suitable format

Returns:dictionary
TSConfiguration.create(obj, *args, **kwargs)

Return SQL statements to CREATE the configuration

Returns:SQL statements

Text Search Configuration Dictionary

TSConfigurationDict is derived from DbObjectDict. It is a dictionary that represents the collection of text search configurations in a database.

class pyrseas.dbobject.textsearch.TSConfigurationDict(dbconn=None)

The collection of text search configurations in a database

TSConfigurationDict.from_map(schema, inconfigs)

Initialize the dictionary of configs by examining the input map

Parameters:
  • schema – schema owning the configurations
  • inconfigs – input YAML map defining the configurations
TSConfigurationDict.diff_map(inconfigs)

Generate SQL to transform existing configurations

Parameters:input_map – a YAML map defining the new configurations
Returns:list of SQL statements

Compares the existing configuration definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the configurations accordingly.

Text Search Dictionary

TSDictionary is derived from DbSchemaObject and represents a PostgreSQL text search dictionary.

class pyrseas.dbobject.textsearch.TSDictionary(**attrs)

A text search dictionary definition

TSDictionary.create(obj, *args, **kwargs)

Return SQL statements to CREATE the dictionary

Returns:SQL statements

Text Search Dictionary Dictionary

TSDictionaryDict is derived from DbObjectDict. It is a Python dictionary that represents the collection of text search dictionaries in a database.

class pyrseas.dbobject.textsearch.TSDictionaryDict(dbconn=None)

The collection of text search dictionaries in a database

TSDictionaryDict.from_map(schema, indicts)

Initialize the dictionary of dictionaries by examining the input map

Parameters:
  • schema – schema owning the dictionaries
  • indicts – input YAML map defining the dictionaries
TSDictionaryDict.diff_map(indicts)

Generate SQL to transform existing dictionaries

Parameters:input_map – a YAML map defining the new dictionaries
Returns:list of SQL statements

Compares the existing dictionary definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the dictionaries accordingly.

Text Search Parser

TSParser is derived from DbSchemaObject and represents a PostgreSQL text search parser.

class pyrseas.dbobject.textsearch.TSParser(**attrs)

A text search parser definition

TSParser.create(obj, *args, **kwargs)

Return SQL statements to CREATE the parser

Returns:SQL statements

Text Search Parser Dictionary

TSParserDict is derived from DbObjectDict. It is a dictionary that represents the collection of text search parsers in a database.

class pyrseas.dbobject.textsearch.TSParserDict(dbconn=None)

The collection of text search parsers in a database

TSParserDict.from_map(schema, inparsers)

Initialize the dictionary of parsers by examining the input map

Parameters:
  • schema – schema owning the parsers
  • inparsers – input YAML map defining the parsers
TSParserDict.diff_map(inparsers)

Generate SQL to transform existing parsers

Parameters:input_map – a YAML map defining the new parsers
Returns:list of SQL statements

Compares the existing parser definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the parsers accordingly.

Text Search Template

TSTemplate is derived from DbSchemaObject and represents a PostgreSQL text search template.

class pyrseas.dbobject.textsearch.TSTemplate(**attrs)

A text search template definition

TSTemplate.create(obj, *args, **kwargs)

Return SQL statements to CREATE the template

Returns:SQL statements

Text Search Template Dictionary

TSTemplateDict is derived from DbObjectDict. It is a dictionary that represents the collection of text search templates in a database.

class pyrseas.dbobject.textsearch.TSTemplateDict(dbconn=None)

The collection of text search templates in a database

TSTemplateDict.from_map(schema, intemplates)

Initialize the dictionary of templates by examining the input map

Parameters:
  • schema – schema owning the templates
  • intemplates – input YAML map defining the templates
TSTemplateDict.diff_map(intemplates)

Generate SQL to transform existing templates

Parameters:input_map – a YAML map defining the new templates
Returns:list of SQL statements

Compares the existing template definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the templates accordingly.