CivicSpleen / ambry

A comprehensive data package manager
BSD 2-Clause "Simplified" License
4 stars 5 forks source link

Search system for Sqlite3 backent not working from CLI #107

Closed ericbusboom closed 9 years ago

ericbusboom commented 9 years ago

The search system, fails when being called from the library.search.Search object. The problem seems to stem from the way the ambry.library.search_backends.sqlite_backend.DatasetSQLiteIndex#search() function gets connections; it looks like it creates the rank function one connection, then does the search on another. This can be fixed by getting a raw connection to a local variable, then setting the rank function and doing the query on the same raw connection.

However, this bug only exhibits when the database is a file. It does not occur when using the memory database via the sqlite:// dsn.