Skip to main content

Tryton module for Elastic Search

Project description

This module allows tryton records of selected models to be exported to Elastic Search full text search engine.

Configuration

  1. Add a new configuration line to trytond.conf elastic_search_server=es.fulfil.io

  2. Add the models you want to index into document types. Administration > Elastic Search > Document Types

How it works

The module adds an Index Backlog table to which records that need synchronisation with Elastic Search are added.

A tryton CRON task which runs every 1 minute (by default) looks into the backlog index and makes the corresponding update to elastic search.

Records, that are deleted are deleted from the index.

Defining what information gets indexed

By default the only information indexed from a record is the rec_name of the record. If you need more information to be sent, that is possible by defining a new method called elastic_search_json in the model in a custom module and it will be used instead of just rec_name. An example of such a method in the product model is below.

__metaclass__ = PoolMeta

class Product:
    __name__ = "product.product"

    def elastic_search_json(self):
        """
        Return a JSON serializable dictionary of values
        that need to be indexed by the search engine
        """
        return {
            'name': self.name,
            'category': self.category.id,
            'category_name': self.category.name,
        }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trytond_elastic_search-4.0.0.4.tar.gz (10.4 kB view details)

Uploaded Source

File details

Details for the file trytond_elastic_search-4.0.0.4.tar.gz.

File metadata

File hashes

Hashes for trytond_elastic_search-4.0.0.4.tar.gz
Algorithm Hash digest
SHA256 5b03ffd00969af42a2f39ee4ee8b16fbef2b3bab3201dc9dfbfe37710f67d723
MD5 49ac265c3b339ce2d526918b1adc8026
BLAKE2b-256 b8950c70d630f7c7b88efb86849c6bcb2142071257d9369c85de55b1a82958f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page