Edit online

How to Set Up the Database for Oxygen Text Search Service

Supported databases:
  • PostgreSQL 11
  • PostgreSQL 12

To connect Oxygen Text Search Service to the PostgreSQL database, follow these steps:

  1. Create a database user that will be used by Oxygen Text Search Service to connect to the database. For example, feedback_db_user:
    CREATE USER feedback_db_user WITH PASSWORD 'password';

    For more details, see: https://www.postgresql.org/docs/12/sql-createuser.html.

  2. Create the database where Oxygen Text Search Service will store its data. For example, otss_db:
    CREATE DATABASE otss_db ENCODING='UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE='template0';

    The database must have the encoding set of UTF8. For more details, see: https://www.postgresql.org/docs/12/sql-createdatabase.html.

  3. The user needs to have permission to connect to the database, create and populate the tables, etc. You can provide these permissions with the following command:
    GRANT ALL PRIVILEGES ON DATABASE otss_db TO feedback_db_user;

    For more details, see: https://www.postgresql.org/docs/12/sql-grant.html.

  4. Configure Oxygen Text Search Service to connect to the database:
    1. Edit the $OXYGEN_FEEDBACK_INSTALL_DIR/docker-compose.yml file.
    2. Configure Oxygen Text Search Service with the following environment variables:
        text-search-service:
          # [...]
          environment:
            - spring.datasource.url=jdbc:postgresql://localhost:5432/otss_db
            - spring.datasource.username=feedback_db_user
            - spring.datasource.password=password