{"id":37775970,"url":"https://github.com/basalam/metabase-search","last_synced_at":"2026-01-16T15:00:23.521Z","repository":{"id":110841351,"uuid":"586515362","full_name":"basalam/Metabase-Search","owner":"basalam","description":"Better searching for https://github.com/metabase/metabase/","archived":false,"fork":false,"pushed_at":"2025-04-07T18:02:18.000Z","size":168,"stargazers_count":9,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T19:22:29.507Z","etag":null,"topics":["async","black","brotli","cache","fastapi","metabase","postgresql","python","search"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/basalam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-08T12:27:25.000Z","updated_at":"2025-02-01T18:59:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"5999a142-7639-4c10-b05a-16c162bd8e41","html_url":"https://github.com/basalam/Metabase-Search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/basalam/Metabase-Search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2FMetabase-Search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2FMetabase-Search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2FMetabase-Search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2FMetabase-Search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basalam","download_url":"https://codeload.github.com/basalam/Metabase-Search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basalam%2FMetabase-Search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","black","brotli","cache","fastapi","metabase","postgresql","python","search"],"created_at":"2026-01-16T15:00:17.585Z","updated_at":"2026-01-16T15:00:23.480Z","avatar_url":"https://github.com/basalam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metabase Search\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/7b29b7293f5364b50b8e/maintainability)](https://codeclimate.com/github/basalam/Metabase-Search/maintainability)\n\nBetter searching for [metabase](https://github.com/metabase/metabase/)\n\n## How it works?\n\nWe are running the same query as metabase but faster and no bugs\n\nthe goal is to reach a response that look likes `sample.json` file\n\n## Metabase Version\n\nWe try to support the latest version of metabase but here we have a table that you can get help from it for selecting docker tag (if you are not using Docker use provided DockerTag as CommitHash when cloning/checking-out) [\"X\" Means every number could be there]\n\n| DockerTag | Tested Metabase version |\n-|-\n|3721849|v0.45.X|\n|5498835|v0.46.X|\n|651d0f9|v0.47.X|\n\n### With the help of\n\n- asyncpg\n- brotli\n- fastapi (with orjson)\n- httpx (with http2 and brotli enabled)\n- aiocache (customized)\n- pydantic\n\nAt every request we are sending a request to metabase current user api to verify the user and also getting the user_id (don't worry we are caching that response for 10 minutes)\n\nit accepts whatever metabase frontend sends and will act just like normal metabase search api\n\nit has a connection pool from 1 to 25 number of connections and keep-alive connections to metabase api (for user data and authentication)\n\nand will read the `search_query.sql` file and compress that using brotli for better performance and less memory usage\n\nalso we are caching search result for 10 minutes\n\n## How to use\n\nFirst of all I recommend to run `gin_index.sql` file inside your PostgreSQL, it will make your db faster when running `LIKE` queries\n\n\u003e It will make PostgreSQL Memory usage higher (Also don't forget to increase SHM Size if you are running your PostgreSQL inside Docker without that you will get some low space on device errors)\n\nJust deploy it like a normal fastapi project\n\n\u003e You need python 3.11 or higher to run this project (That's a bit crazy, but we are using some pretty typing features)\n\u003e\n\u003e maximum number of connections to db = number of project replicas \\* (number of uvicorn workers \\* 25)\n\nand point the `/api/search` location to this project\n\n\u003e no rewrite needed when using reverse proxy (if your metabase is not in subpath)\n\nEnvironment Variables (Case insensitive):\n\n```.env\n# base URL of Metabase\nMB__BASE_URL\n# Maximum number of connections to Metabase HTTP API (for user info) (defualts to 25)\nMB__MAX_CONNECTIONS\n# Host name for database (Could be a readonly address)\nDB__HOST\n# Port number for database (Could be a readonly port)\nDB__PORT\n# Username for database connection (Could be a readonly user)\nDB__USER\n# Password for database connection\nDB__PASSWORD\n# Name of the database\nDB__DBNAME\n# Minimum number of connections to database (defualts to 1)\nDB__MIN_CONNECTIONS\n# Maximum number of connections to database (defualts to 25)\nDB__MAX_CONNECTIONS\n# Database Engine (for now only pg is supported) (defualts to 'pg')\nDB__ENGINE\n# Time-To-Live for caches in second (search and user info) (defualts to 600)\nCACHE__TTL\n# Engine for caches (one of redis, memcached or memory) (defualts to memory)\nCACHE__ENGINE\n# Endpoint for caches (for example: 127.0.0.1) (defualts to None)\nCACHE__ENDPOINT\n# Port for caches (for example: 6379) (defualts to None)\nCACHE__PORT\n# DB for caches (for example: 0) (defualts to None)\nCACHE__DB\n# DB for caches (for example: 3ecr\u0026t) (defualts to None)\nCACHE__PASSWORD\n# Minimum size for cache connection pool (for example: 1) (defualts to None)\nCACHE__POOL_MIN_SIZE\n# Maximum size for cache connection pool (for example: 12) (defualts to None)\nCACHE__POOL_MAX_SIZE\n```\n\n**Storngly Recommended** You can checkout [deploy](./deploy) directory to see a full example of how to deploy this using `docker-compose` and NginX near a real metabase\n\n## Contributing\n\nFeel free to contribute to open new PRs to this project\n\nWe are using `black` formatter as python formatter and some other linters, checkers and fixers that you can find them at [.pre-commit-config.yaml](.pre-commit-config.yaml) file\n\nI would recommend to use `pre-commit`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasalam%2Fmetabase-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasalam%2Fmetabase-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasalam%2Fmetabase-search/lists"}