{"id":16950593,"url":"https://github.com/vcaesar/go-gse-elastic","last_synced_at":"2026-04-01T23:34:19.741Z","repository":{"id":47076876,"uuid":"358344824","full_name":"vcaesar/go-gse-elastic","owner":"vcaesar","description":"Go search house by gse and Elasticsearch","archived":false,"fork":false,"pushed_at":"2021-10-10T16:40:12.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T20:46:03.032Z","etag":null,"topics":["elasticsearch","go","gse","search"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vcaesar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-15T17:45:19.000Z","updated_at":"2023-10-27T22:37:22.000Z","dependencies_parsed_at":"2022-09-14T22:21:12.980Z","dependency_job_id":null,"html_url":"https://github.com/vcaesar/go-gse-elastic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vcaesar/go-gse-elastic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaesar%2Fgo-gse-elastic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaesar%2Fgo-gse-elastic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaesar%2Fgo-gse-elastic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaesar%2Fgo-gse-elastic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vcaesar","download_url":"https://codeload.github.com/vcaesar/go-gse-elastic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaesar%2Fgo-gse-elastic/sbom","scorecard":{"id":917291,"data":{"date":"2025-08-11","repo":{"name":"github.com/vcaesar/go-gse-elastic","commit":"ddf2a0b20e25ca8c477dbc4cefbdecc0b3d66dc9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/10 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/vcaesar/go-gse-elastic/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/vcaesar/go-gse-elastic/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 goCommand 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":"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:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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 'main'"],"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":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"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-24T21:30:32.071Z","repository_id":47076876,"created_at":"2025-08-24T21:30:32.071Z","updated_at":"2025-08-24T21:30:32.071Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"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":["elasticsearch","go","gse","search"],"created_at":"2024-10-13T21:58:05.318Z","updated_at":"2026-04-01T23:34:19.721Z","avatar_url":"https://github.com/vcaesar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-gse-elastic\n\n## Put mapping\n```json\n\"analyzer\": {\n    \"gse_analyzer\": {\n        \"type\": \"custom\",\n        \"tokenizer\": \"whitespace\",\n        \"filter\": [\"es_synonym\"]\n    }\n}\n```\n\n```json\n\"title\": {\n\t\"type\": \"keyword\"\n},\n\"title_index\": {\n    \"type\": \"text\",\n    \"analyzer\": \"gse_analyzer\"\n}\n```\n\n## Index\n\nCreate a new [client](/es/client.go) by [elastic](https://github.com/olivere/elastic) and config your elasticsearch servers.\n\n```go\nfunc (c *Client) data(m map[string]interface{}) map[string]interface{} {\n\tm[\"title_index\"] = c.seg.CutHtml(m[\"title\"].(string))\n\tm[\"describe_index\"] = c.seg.CutHtml(m[\"describe\"].(string))\n\tm[\"addr_index\"] = c.seg.CutHtml(m[\"addr\"].(string))\n\treturn m\n}\n\nfunc (c *Client) Index(m map[string]interface{}) error {\n\t_, err := c.Client.Index().Index(House).\n\t\tRouting(fmt.Sprintf(\"%d\", m[\"city_id\"])).\n\t\tId(m[\"id\"].(string)).\n\t\tBodyJson(m).Do(c.ctx)\n\n\treturn err\n}\n```\n\n## Search\n\n```go\n// github.com/olivere/elastic/v7\n\nfunc (c *Client) query(title string, cityId, districtId int64,\n\tpage, count int) (int64, []map[string]interface{}, error) {\n    qry := elastic.NewBoolQuery().Filter(elastic.NewTermQuery(\"city_id\", cityId))\n    qry.Must(\n            elastic.NewTermQuery(\"title_index\", c.seg.CutHtml(title)),\n        )\n    \n    res, err := c.Client.Search(House).\n\t\tQuery(qry).\n\t\tIgnoreUnavailable(true).\n\t\tFrom(page * count).Size(count).\n\t\tTrackTotalHits(true).\n\t\tDo(c.ctx)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\tresults := make([]map[string]interface{}, 0)\n\tfor _, r := range res.Hits.Hits {\n\t\tvar data map[string]interface{}\n\t\tif err := json.Unmarshal(r.Source, \u0026data); err != nil {\n\t\t\treturn 0, nil, err\n\t\t}\n\n\t\tresults = append(results, data)\n\t}\n\n\treturn res.TotalHits(), results, nil\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvcaesar%2Fgo-gse-elastic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvcaesar%2Fgo-gse-elastic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvcaesar%2Fgo-gse-elastic/lists"}