{"id":16798449,"url":"https://github.com/flosch/trindex","last_synced_at":"2025-03-22T02:30:51.484Z","repository":{"id":22411331,"uuid":"25748753","full_name":"flosch/trindex","owner":"flosch","description":"Trigram search library for Go","archived":false,"fork":false,"pushed_at":"2014-10-27T18:35:29.000Z","size":211,"stargazers_count":69,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T06:51:33.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.florian-schlachter.de/trindex/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flosch.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}},"created_at":"2014-10-25T22:20:32.000Z","updated_at":"2025-02-08T12:15:45.000Z","dependencies_parsed_at":"2022-08-20T13:00:51.474Z","dependency_job_id":null,"html_url":"https://github.com/flosch/trindex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2Ftrindex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2Ftrindex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2Ftrindex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2Ftrindex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flosch","download_url":"https://codeload.github.com/flosch/trindex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244897743,"owners_count":20528285,"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":[],"created_at":"2024-10-13T09:25:39.224Z","updated_at":"2025-03-22T02:30:51.097Z","avatar_url":"https://github.com/flosch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trindex\n\n[![GoDoc](https://godoc.org/github.com/flosch/trindex?status.png)](https://godoc.org/github.com/flosch/trindex)\n[![Build Status](https://travis-ci.org/flosch/trindex.svg?branch=master)](https://travis-ci.org/flosch/trindex)\n[![gratipay](http://img.shields.io/badge/gratipay-support%20trindex-brightgreen.svg)](https://gratipay.com/flosch/)\n\ntrindex is a trigram search library for terms written for and in Go (in alpha stage!). It provides a very simple API\nand ships with its own database.\n\nI put up a demo page online using trindex. I indexed all German wikidata lemmas (4064962 titles in total) and\nmade them available for search: https://www.florian-schlachter.de/trindex/\n\nThe Wikidata example (build \u0026 query) is in the repository as well: [`examples/wikidata`](https://github.com/flosch/trindex/tree/master/examples/wikidata).\n\n```go\nidx := trindex.NewIndex(\"trindex.db\")\ndefer idx.Close()\n\ndataset := []string{\n    \"Mallorca\", \"Ibiza\", \"Menorca\", \"Pityusen\", \"Formentera\", \n    \"Berlin\", \"New York\", \"Yorkshire\",\n}\n\nfor _, data := range dataset {\n    id := idx.Insert(data)\n    // Use ID to connect the term with the associated dataset;\n    // for example save the ID in your SQL database about travel destinations\n}\n\nresults := idx.Query(\"malorka\", 3, 0.3)\n\n// Returns a sorted list of 3 results including the ID and\n// a confidence number (\"Similarity\"; 1 = best match) \u003e= 0.3 \n```\n\ntrindex relies heavily on caching; it's API is safe for concurrent use. Please make sure that you'll call `idx.Close()`\n**in any case** on application shutdown (to flush inserted data to disk).\n\n## Related blog posts\n\n * [trindex: A trigram search library for Go](https://www.florian-schlachter.de/post/trindex/) [26th Oct 2014]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosch%2Ftrindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflosch%2Ftrindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosch%2Ftrindex/lists"}