{"id":21994497,"url":"https://github.com/codelibs/elasticsearch-vector","last_synced_at":"2025-04-30T17:01:50.157Z","repository":{"id":45423291,"uuid":"194564130","full_name":"codelibs/elasticsearch-vector","owner":"codelibs","description":"Vector type and search functions for Elasticsearch","archived":false,"fork":false,"pushed_at":"2022-10-05T18:20:25.000Z","size":62,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T18:04:37.818Z","etag":null,"topics":[],"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/codelibs.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":"2019-06-30T21:45:21.000Z","updated_at":"2020-12-17T02:34:48.000Z","dependencies_parsed_at":"2022-08-31T07:20:30.660Z","dependency_job_id":null,"html_url":"https://github.com/codelibs/elasticsearch-vector","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelibs%2Felasticsearch-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelibs%2Felasticsearch-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelibs%2Felasticsearch-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelibs%2Felasticsearch-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codelibs","download_url":"https://codeload.github.com/codelibs/elasticsearch-vector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748929,"owners_count":21637413,"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-11-29T21:09:30.859Z","updated_at":"2025-04-30T17:01:48.946Z","avatar_url":"https://github.com/codelibs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Elasticsearch Vector Plugin\n=======================\n\n## Overview\n\nVector Plugin provides bit\\_vector type for searcing documents.\n\n## Version\n\n[Versions in Maven Repository](https://repo1.maven.org/maven2/org/codelibs/elasticsearch-vector/)\n\n### Issues/Questions\n\nPlease file an [issue](https://github.com/codelibs/elasticsearch-vector/issues \"issue\").\n\n## Installation\n\n    $ $ES_HOME/bin/elasticsearch-plugin install org.codelibs:elasticsearch-vector:7.5.0\n\n## Getting Started\n\n### Set Vector Field Type\n\nThis plugin provides the following field type:\n\n- bit\\_vector\n\n```\n    $ curl -XPUT 'localhost:9200/my_index' -d '{\n    {\n      \"mappings\": {\n        \"properties\": {\n          \"my_vector\": {\n            \"type\": \"bit_vector\"\n          },\n          \"my_text\" : {\n            \"type\" : \"keyword\"\n          }\n        }\n      }\n    }'\n```\n\n### Add Vector Data\n\n```\n    $ curl -XPUT \"localhost:9200/my_index/_doc/1\" -d '{\n    {\n      \"my_text\" : \"text1\",\n      \"my_vector\" : [0, 1, 1]\n    }'\n```\n\n### Search By Vectors\n\nThis plugin provides the following metrics functions:\n\n- pairwiseHammingDistance\n\nFor examples, the usage is:\n\n```\ncurl -s -XPOST \"localhost:9200/my_index/_search?pretty\" -H \"Content-Type: application/json\" -d \"\n{\n  \\\"query\\\": {\n    \\\"script_score\\\": {\n      \\\"query\\\": {\n        \\\"match_all\\\": {}\n      },\n      \\\"script\\\": {\n        \\\"source\\\": \\\"pairwiseHammingDistance(params.query_vector, doc['my_bit_vector'], true)\\\",\n        \\\"params\\\": {\n          \\\"query_vector\\\": [1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0]\n        }\n      }\n    }\n  }\n}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelibs%2Felasticsearch-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelibs%2Felasticsearch-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelibs%2Felasticsearch-vector/lists"}