Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or Docker Desktop.
- To connect Apache Solr to MindsDB, install the required dependencies following this instruction.
- Install or ensure access to Apache Solr.
Implementation
This handler is implemented using thesqlalchemy-solr library, which provides a Python/SQLAlchemy interface.
The required arguments to establish a connection are as follows:
usernameis the username used to authenticate with the Solr server. This parameter is optional.passwordis the password to authenticate the user with the Solr server. This parameter is optional.hostis the host name or IP address of the Solr server.portis the port number of the Solr server.server_pathdefaults tosolrif not provided.collectionis the Solr Collection name.use_ssldefaults tofalseif not provided.
Further reference: https://pypi.org/project/sqlalchemy-solr/.
Usage
In order to make use of this handler and connect to the Solr database in MindsDB, the following syntax can be used:RequirementsA Solr instance with a Parallel SQL supported up and running.There are certain limitations that need to be taken into account when issuing queries to Solr. Refer to https://solr.apache.org/guide/solr/latest/query-guide/sql-query.html#parallel-sql-queries.
Don’t forget to put limit in the end of the SQL statement