{"id":38235007,"url":"https://github.com/rekki/go-query-index","last_synced_at":"2026-01-17T01:04:21.688Z","repository":{"id":49570185,"uuid":"255442828","full_name":"rekki/go-query-index","owner":"rekki","description":"Search index for go-query","archived":false,"fork":false,"pushed_at":"2021-06-14T07:12:08.000Z","size":202,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-27T22:34:49.626Z","etag":null,"topics":["analyzer","index","lucene","query","search","tokenizer"],"latest_commit_sha":null,"homepage":null,"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/rekki.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T21:12:43.000Z","updated_at":"2021-06-14T07:12:11.000Z","dependencies_parsed_at":"2022-08-26T04:44:09.580Z","dependency_job_id":null,"html_url":"https://github.com/rekki/go-query-index","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/rekki/go-query-index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekki%2Fgo-query-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekki%2Fgo-query-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekki%2Fgo-query-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekki%2Fgo-query-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rekki","download_url":"https://codeload.github.com/rekki/go-query-index/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekki%2Fgo-query-index/sbom","scorecard":{"id":769650,"data":{"date":"2025-08-11","repo":{"name":"github.com/rekki/go-query-index","commit":"58d057600a017a9fc54f96839f7f743e365b3705"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/rekki/go-query-index/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/rekki/go-query-index/test.yml/master?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/test.yml:37","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T01:53:14.646Z","repository_id":49570185,"created_at":"2025-08-23T01:53:14.646Z","updated_at":"2025-08-23T01:53:14.646Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["analyzer","index","lucene","query","search","tokenizer"],"created_at":"2026-01-17T01:04:21.499Z","updated_at":"2026-01-17T01:04:21.672Z","avatar_url":"https://github.com/rekki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# index [![GitHub Actions Status](https://github.com/rekki/go-query-index/workflows/test/badge.svg?branch=master)](https://github.com/rekki/go-query-index/actions) [![codecov](https://codecov.io/gh/rekki/go-query-index/branch/master/graph/badge.svg)](https://codecov.io/gh/rekki/go-query-index) [![GoDoc](https://godoc.org/github.com/rekki/go-query-index?status.svg)](https://godoc.org/github.com/rekki/go-query-index)\n\n\u003e ## Search index for go-query\n\nIllustration of how you can use `go-query-index` to build a somewhat functional search index for `go-query`:\n\n```go\npackage main\n\nimport (\n  \"log\"\n\n  iq \"github.com/rekki/go-query\"\n  \"github.com/rekki/go-query-index/analyzer\"\n  \"github.com/rekki/go-query-index\"\n)\n\ntype ExampleCity struct {\n  Name    string\n  Country string\n}\n\nfunc (e *ExampleCity) IndexableFields() map[string][]string {\n  out := map[string][]string{}\n\n  out[\"name\"] = []string{e.Name}\n  out[\"name_fuzzy\"] = []string{e.Name}\n  out[\"name_soundex\"] = []string{e.Name}\n  out[\"country\"] = []string{e.Country}\n\n  return out\n}\n\nfunc toDocuments(in []*ExampleCity) []index.Document {\n  out := make([]index.Document, len(in))\n  for i, d := range in {\n    out[i] = index.Document(d)\n  }\n  return out\n}\n\nfunc main() {\n  m := index.NewMemOnlyIndex(map[string]*analyzer.Analyzer{\n    \"name\":         index.AutocompleteAnalyzer,\n    \"name_fuzzy\":   index.FuzzyAnalyzer,\n    \"name_soundex\": index.SoundexAnalyzer,\n    \"country\":      index.IDAnalyzer,\n  })\n\n  list := []*ExampleCity{\n    \u0026ExampleCity{Name: \"Amsterdam\", Country: \"NL\"},\n    \u0026ExampleCity{Name: \"Amsterdam University\", Country: \"NL\"},\n    \u0026ExampleCity{Name: \"Amsterdam University Second\", Country: \"NL\"},\n    \u0026ExampleCity{Name: \"London\", Country: \"UK\"},\n    \u0026ExampleCity{Name: \"Sofia\", Country: \"BG\"},\n  }\n\n  m.Index(toDocuments(list)...)\n\n  // search for \"(name:aMS OR name:u) AND (country:NL OR country:BG)\"\n\n  query := iq.Or(\n    iq.And(\n      iq.Or(m.Terms(\"name\", \"aMS u\")...),\n      iq.Or(m.Terms(\"country\", \"NL\")...),\n    ).SetBoost(2),\n    iq.And(\n      iq.Or(m.Terms(\"name_fuzzy\", \"bondom u\")...),\n      iq.Or(m.Terms(\"country\", \"UK\")...),\n    ).SetBoost(0.1),\n    iq.And(\n      iq.Or(m.Terms(\"name_soundex\", \"sfa\")...),\n      iq.Or(m.Terms(\"country\", \"BG\")...),\n    ).SetBoost(0.01),\n  )\n  log.Printf(\"query: %v\", query.String())\n  m.Foreach(query, func(did int32, score float32, doc index.Document) {\n    city := doc.(*ExampleCity)\n    log.Printf(\"%v matching with score %f\", city, score)\n  })\n}\n```\n\nwill print\n\n```sh\n2019/12/03 18:40:11 \u0026{Amsterdam NL} matching with score 3.923317\n2019/12/03 18:40:11 \u0026{Amsterdam University NL} matching with score 6.428843\n2019/12/03 18:40:11 \u0026{Amsterdam University NL Second} matching with score 6.428843\n2019/12/03 18:40:11 \u0026{London UK} matching with score 0.537528\n2019/12/03 18:40:11 \u0026{Sofia BG} matching with score 0.035835\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekki%2Fgo-query-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frekki%2Fgo-query-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekki%2Fgo-query-index/lists"}