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(name, schema, description, owner, parser, oid=None)

A text search configuration definition

static TSConfiguration.from_map(name, schema, inobj)

Initialize a configuration instance from a YAML map

Parameters:
  • name – configuration name
  • name – schema map
  • inobj – YAML map of the configuration
Returns:

configuration instance

TSConfiguration.to_map(db, 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

Text Search Dictionary

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

class pyrseas.dbobject.textsearch.TSDictionary(name, schema, description, owner, template, options, oid=None)

A text search dictionary definition

static TSDictionary.from_map(name, schema, inobj)

Initialize a dictionary instance from a YAML map

Parameters:
  • name – dictionary name
  • name – schema map
  • inobj – YAML map of the dictionary
Returns:

dictionary instance

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

Text Search Parser

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

class pyrseas.dbobject.textsearch.TSParser(name, schema, description, start, gettoken, end, headline, lextypes, oid=None)

A text search parser definition

static TSParser.from_map(name, schema, inobj)

Initialize a parser instance from a YAML map

Parameters:
  • name – parser name
  • name – schema map
  • inobj – YAML map of the parser
Returns:

parser instance

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

Text Search Template

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

class pyrseas.dbobject.textsearch.TSTemplate(name, schema, description, init, lexize, oid=None)

A text search template definition

static TSTemplate.from_map(name, schema, inobj)

Initialize a template instance from a YAML map

Parameters:
  • name – template name
  • name – schema map
  • inobj – YAML map of the template
Returns:

template instance

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