{"id":27969190,"url":"https://github.com/future-architect/watertower","last_synced_at":"2025-10-13T04:12:38.934Z","repository":{"id":55679032,"uuid":"249409482","full_name":"future-architect/watertower","owner":"future-architect","description":"serverless search engine","archived":false,"fork":false,"pushed_at":"2023-03-07T03:10:43.000Z","size":397,"stargazers_count":34,"open_issues_count":2,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-15T13:36:59.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/future-architect.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":"2020-03-23T11:14:57.000Z","updated_at":"2025-01-03T05:47:01.000Z","dependencies_parsed_at":"2024-06-19T01:20:10.896Z","dependency_job_id":"75a1ec3c-dc69-4f35-83fe-f69c67205a48","html_url":"https://github.com/future-architect/watertower","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/future-architect/watertower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Fwatertower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Fwatertower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Fwatertower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Fwatertower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-architect","download_url":"https://codeload.github.com/future-architect/watertower/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Fwatertower/sbom","scorecard":{"id":414679,"data":{"date":"2025-08-11","repo":{"name":"github.com/future-architect/watertower","commit":"b176ca81b8ed265c3bd7158d16ecb9c5d65046b3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":-1,"reason":"no workflows found","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":"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":"Code-Review","score":0,"reason":"Found 1/23 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":-1,"reason":"No tokens found","details":null,"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":"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile.aws-lambda:1","Warn: containerImage not pinned by hash: Dockerfile.aws-lambda:15","Warn: containerImage not pinned by hash: Dockerfile.aws-lambda:30: pin your Docker image by updating amazon/aws-lambda-go to amazon/aws-lambda-go@sha256:39b1aa138257a4f03fd53c388f9511e166a81ccdc3efda2f21185dba4c5efba2","Info:   0 out of   3 containerImage 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":"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 2 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":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0112 / GHSA-f6mq-5m25-4r72","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9"],"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-18T23:31:55.671Z","repository_id":55679032,"created_at":"2025-08-18T23:31:55.671Z","updated_at":"2025-08-18T23:31:55.671Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013591,"owners_count":26085390,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-07T21:08:56.294Z","updated_at":"2025-10-13T04:12:38.893Z","avatar_url":"https://github.com/future-architect.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# watertower\n\n[![GoDoc](https://godoc.org/github.com/future-architect/watertower?status.svg)](https://godoc.org/github.com/future-architect/watertower)\n\n![watertower](website/watertower.jpg)`\n\n[© Copyright Steve Daniels and licensed under CC BY-SA 2.0](https://www.geograph.org.uk/photo/3103724)\n\nSearch Engine for Serverless environment.\n\n* Search via words in documents\n* Filter by tag\n\n## Architecture\n\nThis API uses standard inverted index to achieve search. When searching, calculate score by TFIDF algorithm and sort.\n\nThis tool is using [gocloud.dev's docstore](https://gocloud.dev/howto/docstore/) as an storage.\nSo it can run completely managed environment (DynamoDB, Google Firestore, Azure CosmosDB) and MongoDB.\n\nElasticsearch can use flexible document, but this watertower can use only the following structure.\n``\"title\"`` and ``\"content\"`` are processed (tokenize, stemming, remove stop words) by packages in ``github.com/future-architect/nlp``.\nNow only English and Japanese are implemented.\n\n```json\n{\n  \"unique_key\": \"100\",\n  \"lang\": \"en\",\n  \"title\": \"100 Continue\",\n  \"tags\": [\"100\", \"no-error\"],\n  \"content\": \"This interim response indicates that everything so far is OK and that the client should continue the request, or ignore the response if the request is already finished.\",\n  \"metadata\": {\"this is not\":  \"searchable, but you can store any strings\"}\n}\n```\n\n## Go API\n\nBasically, this is an document storage. All API you should handle is ``WaterTower`` struct.\nTo create instance, you can pass URL.\n\nBefore using this search engine, you should import several packages:\n\n```go\nimport (\n    // Natural languages you want to use\n\t_ \"github.com/future-architect/watertower/nlp/english\"\n\t_ \"github.com/future-architect/watertower/nlp/japanese\"\n\n    // The storage backends you want to use.\n\t_ \"gocloud.dev/docstore/memdocstore\"\n\t_ \"gocloud.dev/docstore/awsdynamodb\"\n\t_ \"gocloud.dev/docstore/gcpfirestore\"\n\t_ \"gocloud.dev/docstore/mongodocstore\"\n)\n```\n\nEach storage should be initialized table with \"id\" as a primary key(partition key for DynamoDB).\n``Index`` will be a table name.\n\n```go\nwt, err := watertower.NewWaterTower(ctx, watertower.Option{\n    DocumentUrl: \"dynamodb://\", // default is \"mem://\"\n    Index:       \"docs\",        // default is \"index\"\n})\n```\n\nTo store document, call ``PostDocument()`` method.\n\n```go\ndocID, err := wt.PostDocument(\"unique-document-key\", \u0026watertower.Document{\n    Language: \"en\",                               // required\n    Title: \"title\",                               // document title\n    Content: \"content\",                           // document body\n    Tags: []string{\"tag\"},                        // tags\n    Metadata: map[string]string{\"extra\": \"data\"}, // extra data\n})\n```\n\nTo get document, you can use by unique-key or document-id.\n\n```go\ndoc, err := wt.FindDocumentByKey(uniqueKey)\ndocs, err := wt.FindDocuments(id1, id2)\n```\n\nTo search document, use ``Search()`` method. First parameter is natural language search word for\ntitle and content. Second parameter is tags to filter result. Third parameter is natural language name\nto process search word.\n\n```go\ndocs, err := wt.Search(searchWord, tags, lang)\n```\n\nTo use local index file, open watertower instance without DocumentUrl option.\n\nThen call ``ReadIndex(r io.Reader)`` for/and ``WriteIndex(w io.Writer)`` to read/store index:\n\n```go\nf, err := os.Open(\"watertower.idx\")\nif err != nil {\n\tpanic(err)\n}\n\nwt, err := watertower.NewWaterTower(ctx, watertower.Option{\n    DefaultLanguage: *defaultLanguage,\n})\nwt.ReadIndex(f)\n```\n\n### Sample Codes\n\n#### httpstatus in /samples/httpstatus\n\nCLI tool to search http status code. It reads from bundled documents and registeres them when booting.\nIt uses memdocstore as a backend datastore.\n\n## HTTP interface\n\n``watertower-server`` in ``/cmd/watertower-server`` implements Elasticsearch inspired API.\n\n```sh\n./watertower-server --port=8888\n```\n\n```sh\n# Register document\n$ curl -X POST \"http://127.0.0.1:8888/index/_doc/\"\n　　-H \"content-type: application/json\"\n　　-d '{ \"unique_key\": \"id1\", \"title\": \"hello watertower\",\n　　　　　\"content\": \"watertower is a full text search engine with tag filtering\", \"lang\": \"en\" }'\n{\"_id\":\"d1\",\"_index\":\"index\",\"_type\":\"_doc\",\"result\":\"created\"}\n\n# Get document by unique-key\n$ curl -X GET \"http://127.0.0.1:8888/index/_search?q=unique_key%3Aid1\"\n    -H\"content-type: application/json\"\n{\"hits\":{\"hits\":[{\"_id\":\"d1\",\"_index\":\"index\",\"_source\":{\"content\":\"watertower is a full text search engine with tag filtering\",\"lang\":\"en\",\"metadata\":{},\"tags\":null,\"title\":\"hello watertower\",\"unique_key\":\"id1\"},\"_type\":\"_doc\",\"sort\":null}],\"total\":{\"total\":1}}}\n\n# Get document by document ID\n$ curl -X GET \"http://127.0.0.1:8888/index/_source/d1\"\n(...)\n\n# Search\n$ curl -X GET \"http://127.0.0.1:8888/index/_search\"\n  -H \"content-type: application/json\"\n  -d '{\"query\": {\"bool\": {\"must\": {\"match_phrase\": {\"content\": {\"query\": \"stay\", \"analyzer\": \"en\"}}}}}}'\n(...)\n```\n\n## CLI tool\n\nCLI tool ``watertower-cli`` in ``/cmd/watertower-cli``.\n\n```shell\n$ ./watertower-cli --help\nusage: watertower-cli [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\n\nFlags:\n  --help  Show context-sensitive help (also try --help-long and --help-man).\n  --default-language=DEFAULT-LANGUAGE  \n          Default language\n\nCommands:\n  help [\u003ccommand\u003e...]\n    Show help.\n\n  create-index [\u003cflags\u003e] \u003cINPUT\u003e\n    Generate Index\n\n  search [\u003cflags\u003e] [\u003cWORDS\u003e...]\n    Search\n```\n\nIt can create single file index by using ``create-index`` sub command.\n\nYou can try searching the index file with ``search`` sub command.\n\n## License\n\nApache2\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-architect%2Fwatertower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-architect%2Fwatertower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-architect%2Fwatertower/lists"}