{"id":22454433,"url":"https://github.com/o19s/user-behavior-insights-elasticsearch","last_synced_at":"2026-03-05T00:33:05.969Z","repository":{"id":265888141,"uuid":"868935307","full_name":"o19s/user-behavior-insights-elasticsearch","owner":"o19s","description":"User Behavior Insights (UBI) plugin for Elasticsearch","archived":false,"fork":false,"pushed_at":"2024-10-09T15:03:02.000Z","size":82,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-13T14:33:45.598Z","etag":null,"topics":["elasticsearch","ubi"],"latest_commit_sha":null,"homepage":"","language":"Java","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/o19s.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":"2024-10-07T12:45:41.000Z","updated_at":"2025-06-16T11:44:12.000Z","dependencies_parsed_at":"2024-12-01T11:38:35.361Z","dependency_job_id":"e56fbfba-d1c2-4dbd-a5d7-c58a5ecbf30f","html_url":"https://github.com/o19s/user-behavior-insights-elasticsearch","commit_stats":null,"previous_names":["o19s/user-behavior-insights-elasticsearch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/o19s/user-behavior-insights-elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Fuser-behavior-insights-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Fuser-behavior-insights-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Fuser-behavior-insights-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Fuser-behavior-insights-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o19s","download_url":"https://codeload.github.com/o19s/user-behavior-insights-elasticsearch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Fuser-behavior-insights-elasticsearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30102399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T23:59:36.199Z","status":"ssl_error","status_checked_at":"2026-03-04T23:56:48.556Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["elasticsearch","ubi"],"created_at":"2024-12-06T07:07:38.484Z","updated_at":"2026-03-05T00:33:05.931Z","avatar_url":"https://github.com/o19s.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Behavior Insights plugin for Elasticsearch\n\nThis repository contains a User Behavior Insights (UBI) plugin for Elasticsearch. This plugin facilitates the capture of queries to build a better understanding of user behavior. For capturing client-side events, refer to the [o19s/ubi](https://github.com/o19s/ubi) repository. A complete reference implementation is available in [o19s/chorus-opensearch-edition](https://github.com/o19s/chorus-opensearch-edition/) and the concepts illustrated in that repository can apply to an Elasticsearch deployment as well.\n\nThis plugin was adapted from the [UBI plugin for OpenSearch](https://github.com/opensearch-project/user-behavior-insights) but it does differ some. This plugin does not support emitting UBI queries as OTel traces. Additionally, this plugin does not yet contain as comprehensive tests.\n\nJoin us on the #user-behavior-insights channel of the [Relevance Slack](https://opensourceconnections.com/community/). Please use GitHub issues for suggesting features and identifying bugs.\n\nFor more on UBI and its standard for capturing queries and events, see [o19s/ubi](https://github.com/o19s/ubi).\n\n## Using the Plugin in Elasticsearch\n\nDownload a release jar or clone and build the project with `./gradlew build`. This will build a jar file under the `./build` directory. Then install the plugin in Elasticsearch:\n\n```\nbin/elasticsearch-plugin install --batch file:/path/to/build/elasticsearch-ubi-1.0.0-SNAPSHOT.zip\n```\n\n## Building and Running the Plugin for Development and Testing\n\n```\n./gradlew build\ndocker compose build\ndocker compose up\n```\n\nCreate an index:\n\n```\ncurl -X PUT http://localhost:9200/ecommerce\n```\n\nDo a search with UBI (there will be no results since no documents have been indexed):\n\n```\ncurl http://localhost:9200/ecommerce/_search -H \"Content-Type: application/json\" -d'\n {\n   \"query\": {\n     \"match_all\": {}\n   },\n   \"ext\": {\n     \"ubi\": {}\n   }   \n }' \n```\n\nIn your search response you will see UBI information, including a `query_id` since none was provided in the search request.\n\n```\n{\n  \"ext\": {\n    \"ubi\": {\n      \"query_id\": \"49140554-b9ae-4f12-825e-81bc73f140a8\"\n    }\n  },\n  \"hits\": {\n    \"total\": {\n      \"value\": 0,\n      \"relation\": \"eq\"\n    },\n    \"max_score\": null,\n    \"hits\": []\n  }\n}\n```\n\nNow look at the `ubi_queries` index:\n\n```\ncurl http://localhost:9200/ubi_queries/_search | jq\n```\n\nThe query will be captured:\n\n```\n{\n  \"took\": 1,\n  \"timed_out\": false,\n  \"_shards\": {\n    \"total\": 1,\n    \"successful\": 1,\n    \"skipped\": 0,\n    \"failed\": 0\n  },\n  \"hits\": {\n    \"total\": {\n      \"value\": 1,\n      \"relation\": \"eq\"\n    },\n    \"max_score\": 1.0,\n    \"hits\": [\n      {\n        \"_index\": \"ubi_queries\",\n        \"_id\": \"H5IQZ5IBK4HD31_NPnXP\",\n        \"_score\": 1.0,\n        \"_source\": {\n          \"query_response_id\": \"39a29e90-324e-43f5-b449-7f79aee3fde7\",\n          \"user_query\": \"\",\n          \"query_id\": \"49140554-b9ae-4f12-825e-81bc73f140a8\",\n          \"query_response_object_ids\": [],\n          \"query\": \"{\\\"query\\\":{\\\"match_all\\\":{\\\"boost\\\":1.0}},\\\"ext\\\":{\\\"query_id\\\":\\\"49140554-b9ae-4f12-825e-81bc73f140a8\\\",\\\"user_query\\\":null,\\\"client_id\\\":null,\\\"object_id_field\\\":null,\\\"query_attributes\\\":{}}}\",\n          \"query_attributes\": {},\n          \"client_id\": \"\",\n          \"timestamp\": 1728305970620\n        }\n      }\n    ]\n  }\n}\n```\n\nHad there been documents indexed and matched the query, the IDs of the documents would have been returned in the `query_response_object_ids` field.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo19s%2Fuser-behavior-insights-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo19s%2Fuser-behavior-insights-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo19s%2Fuser-behavior-insights-elasticsearch/lists"}