pythonhuggingface-transformerssentence-transformers

txtai.database.sql.base.SQLError: no such function: json_extract


Using TxtAI python module with sql query SELECT id, text, score, solution_id, column_name FROM txtai WHERE similar('{query}') AND score >= 0.5, I am seeing this error txtai.database.sql.base.SQLError: no such function: json_extract

I am trying to use dynamic search using TxtAI module, which uses a SQL based context manager but it is not working as expected.

This are working perfectly on my widows machine, but the same is not happening on the CentOS server. I have tried to maintain all the modules and packages versions same using requirement.txt files.


Solution

  • It looks like the version of SQLite packaged with CentOS 7.9 doesn't have the JSON1 extension enabled. There may be a 3rd party repository with a newer version.

    The link below shows how SQLite could be recompiled with JSON1 enabled.

    https://code.djangoproject.com/wiki/JSON1Extension

    Alternatively, you can try with another Linux distro. Almost all distros released within the last 5 years have JSON1 support enabled.