Search code examples
firebirdsphinxunixodbcfirebird2.5

Unavailable database in combo Sphinx + UnixODBC + Firebird


I'm trying to use Sphinx Search on Firebird via UnixODBC. All components separately work fine: Sphinx passes tests with MySQL samples and ODBC connects to firebird's .fdb

But if I try to connect Sphinx to ODBC, I get this indexing error:

ERROR: index 'fb': sql_connect: [unixODBC][ODBC Firebird Driver]unavailable database (DSN=odbc://:***@:0/).

Here is part of my sphinx.conf:

source src_fb
{
  type=odbc

  odbc_dsn=Driver=/usr/lib/libOdbcFb.so;Dbq=localhost:/var/lib/firebird/2.5/data/employee.fdb;Uid=SYSDBA;Pwd=

  sql_query     = \
  SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
  FROM documents
}

.fdb is the same file ODBC connects to.


Solution

  • Here is the solution: In sphinx.conf I changed only one string: odbc_dsn=DSN=employee

    So now Sphinx takes all required data from ODBC configuration files.

    Database from odbc.ini:

    [employee]
    Description = Firebird
    Driver = Firebird
    Dbname = localhost:/var/lib/firebird/2.5/data/employee.fdb
    User = SYSDBA
    Password =
    Role =
    CharacterSet =
    ReadOnly = No
    NoWait = No
    

    And the driver configs from odbcinst.ini:

    [Firebird]
    Description = Firebird ODBC Driver
    Driver = /usr/lib/libOdbcFb.so
    Threading = 1
    FileUsage = 1
    CPTimeout =
    CPReuse =