{"id":25949833,"url":"https://github.com/xvertile/matrixsearch","last_synced_at":"2026-05-26T23:32:53.533Z","repository":{"id":280345553,"uuid":"941682901","full_name":"xvertile/MatrixSearch","owner":"xvertile","description":"MatrixSearch is a fast, in-memory Go data store that filters and queries any struct using composite indexing. It supports custom and automatic indexing, enabling multi-dimensional searches on complex datasets efficiently. ","archived":false,"fork":false,"pushed_at":"2025-03-02T21:19:12.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T22:23:59.451Z","etag":null,"topics":["composite-index","datastore","golang","performance","query"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xvertile.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-02T21:12:15.000Z","updated_at":"2025-03-02T21:19:15.000Z","dependencies_parsed_at":"2025-03-02T22:34:09.695Z","dependency_job_id":null,"html_url":"https://github.com/xvertile/MatrixSearch","commit_stats":null,"previous_names":["xvertile/matrixsearch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvertile%2FMatrixSearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvertile%2FMatrixSearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvertile%2FMatrixSearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvertile%2FMatrixSearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvertile","download_url":"https://codeload.github.com/xvertile/MatrixSearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241847607,"owners_count":20030292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["composite-index","datastore","golang","performance","query"],"created_at":"2025-03-04T12:29:28.559Z","updated_at":"2026-05-26T23:32:53.497Z","avatar_url":"https://github.com/xvertile.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MatrixSearch: Composite Key Data Store\n\nMatrixSearch is a simple, generic in-memory data store library written in Go. It uses composite indexing to quickly search through your data. With MatrixSearch, you can insert, update, delete, and query any type of struct by automatically generating index keys from your struct's fields.\n\n## What It Is\n\nMatrixSearch lets you filter through your data on multiple dimensions. Whether you have a list of cars, fruits, proxies, or any other structured data, MatrixSearch will allow you to efficiently filter your data at every level of your struct. Think of it as a tool for **multi-field data filtering**.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"examples/dumps/proxies.svg\" alt=\"Proxies Dump\"\u003e\n\u003c/div\u003e\n\n## How It Works\n\n- **Composite Indexing:**  \n  The library generates combinations of keys from your data, using either a custom indexer or automatically via reflection with `text:\"\u003ctag\u003e\"` annotations. These composite keys enable you to search by any combination of fields.\n\n- **Flexible Queries:**  \n  You can perform both full key matches or partial queries. For instance, you can query by a single field or by multiple fields such as model, year, and color all at once.\n\n- **Random Result Retrieval:**  \n  The `SearchRandom` function returns one random item that matches your query, which is useful when you only need a sample from a large dataset.\n\n\n\n\n## Quick Start\n\n1. **Install MatrixSearch:**\n\n   ```bash\n   go get github.com/xvertile/matrixsearch\n   ```\n\n2. **Simple Example:**\n\n   ```go\n   package main\n\n   import (\n       \"fmt\"\n       \"github.com/xvertile/matrixsearch\"\n   )\n\n   type Fruit struct {\n       Name  string  `text:\"name\"`\n       Color string  `text:\"color\"`\n       Price float64 `text:\"price\"`\n   }\n\n   // Custom indexer creates composite keys from the struct.\n   func fruitIndexer(f Fruit) []string {\n       return []string{\"name:\" + f.Name, \"color:\" + f.Color}\n   }\n\n   func main() {\n       ds := matrixsearch.NewDataStore(func(f Fruit) string { return f.Name }, fruitIndexer)\n       apple := Fruit{Name: \"Apple\", Color: \"Red\", Price: 1.5}\n       ds.Insert(apple)\n\n       query := \"name:Apple:color:Red\"\n       results := ds.Search(query)\n       fmt.Println(\"Found fruits:\", results)\n   }\n   ```\n   \nPlease refer to the [examples](examples) directory for more detailed examples.\n\n## Benchmark Highlights\n\nBelow are some sample benchmark results that illustrate MatrixSearch's performance on various datasets:\n\n| Test                     | Size      | Time per Operation |\n|--------------------------|-----------|--------------------|\n| Proxy Search Random      | 10,000    | ~72 ns/op          |\n| Proxy Search Random      | 100,000   | ~83 ns/op          |\n| Proxy Search Random      | 1,000,000 | ~143 ns/op         |\n| Fruit Search Random      | 10,000    | ~44 ns/op          |\n| Fruit Search Random      | 100,000   | ~47 ns/op          |\n| Fruit Search Random      | 1,000,000 | ~37 ns/op          |\n| Car Search Random        | 10,000    | ~37 ns/op          |\n| Car Search Random        | 100,000   | ~44 ns/op          |\n| Car Search Random        | 1,000,000 | ~38 ns/op          |\n\nThese numbers show that MatrixSearch scales well, making it a practical choice for in-memory multi-field data filtering.\n\nRaw benchmark results can be found in the `benchmark` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvertile%2Fmatrixsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvertile%2Fmatrixsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvertile%2Fmatrixsearch/lists"}