{"id":19200409,"url":"https://github.com/redisearch/jredisearch","last_synced_at":"2025-04-06T07:14:15.643Z","repository":{"id":17841340,"uuid":"81722521","full_name":"RediSearch/JRediSearch","owner":"RediSearch","description":"Java Client for RediSearch","archived":false,"fork":false,"pushed_at":"2023-10-15T14:39:01.000Z","size":1703,"stargazers_count":142,"open_issues_count":27,"forks_count":63,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-30T06:06:10.079Z","etag":null,"topics":["java-client","redis","redis-client","redis-search"],"latest_commit_sha":null,"homepage":"https://redisearch.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RediSearch.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":"2017-02-12T11:55:47.000Z","updated_at":"2025-01-17T04:39:10.000Z","dependencies_parsed_at":"2023-10-16T06:28:54.169Z","dependency_job_id":"f848d0fc-a4bc-4c8d-82d9-ba5f8d6c8926","html_url":"https://github.com/RediSearch/JRediSearch","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RediSearch%2FJRediSearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RediSearch%2FJRediSearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RediSearch%2FJRediSearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RediSearch%2FJRediSearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RediSearch","download_url":"https://codeload.github.com/RediSearch/JRediSearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445681,"owners_count":20939961,"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":["java-client","redis","redis-client","redis-search"],"created_at":"2024-11-09T12:32:52.231Z","updated_at":"2025-04-06T07:14:15.622Z","avatar_url":"https://github.com/RediSearch.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![license](https://img.shields.io/github/license/RedisLabs/JRediSearch.svg)](https://github.com/RediSearch/JRediSearch/blob/master/LICENSE)\n[![CircleCI](https://circleci.com/gh/RediSearch/JRediSearch/tree/master.svg?style=svg)](https://circleci.com/gh/RediSearch/JRediSearch/tree/master)\n[![GitHub issues](https://img.shields.io/github/release/RedisLabs/JRediSearch.svg)](https://github.com/RedisLabs/JRediSearch/releases/latest)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.redislabs/jredisearch/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.redislabs/jredisearch)\n[![Javadocs](https://www.javadoc.io/badge/com.redislabs/jredisearch.svg)](https://www.javadoc.io/doc/com.redislabs/jredisearch)\n[![Codecov](https://codecov.io/gh/RediSearch/JRediSearch/branch/master/graph/badge.svg)](https://codecov.io/gh/RediSearch/JRediSearch)\n[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/RediSearch/JRediSearch.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/RediSearch/JRediSearch/context:java)\n[![Known Vulnerabilities](https://snyk.io/test/github/RediSearch/JRediSearch/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/RediSearch/JRediSearch?targetFile=pom.xml)\n\n# JRediSearch\n[![Forum](https://img.shields.io/badge/Forum-RediSearch-blue)](https://forum.redislabs.com/c/modules/redisearch/)\n[![Discord](https://img.shields.io/discord/697882427875393627?style=flat-square)](https://discord.gg/xTbqgTB)\n\nA Java Client Library for [RediSearch](https://oss.redislabs.com/redisearch/)\n\n## Deprecation notice\n\nAs of [jedis 4.0.0](https://github.com/redis/jedis) this library is deprecated. It's features have been merged into jedis. Please either install it [from maven](https://mvnrepository.com/artifact/redis.clients/jedis) or [the repo](https://github.com/redis/jedis).\n\n## Overview \n\nThis project contains a Java library abstracting the API of the RediSearch Redis module, that implements a powerful \nin-memory Secondary Index, Query Engine and Full-Text Search engine inside Redis. \n \n## Installing\n\nJRediSearch is available using the maven central snapshot repository and via official\nreleases.\n\n### Official Releases\n\n```xml\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.redislabs\u003c/groupId\u003e\n      \u003cartifactId\u003ejredisearch\u003c/artifactId\u003e\n      \u003cversion\u003e2.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n```\n\n### Snapshots\n\n```xml\n  \u003crepositories\u003e\n    \u003crepository\u003e\n      \u003cid\u003esnapshots-repo\u003c/id\u003e\n      \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n    \u003c/repository\u003e\n  \u003c/repositories\u003e\n```\n\nand\n```xml\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.redislabs\u003c/groupId\u003e\n      \u003cartifactId\u003ejredisearch\u003c/artifactId\u003e\n      \u003cversion\u003e2.1.0-SNAPSHOT\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n```\n\n## Usage example\n\nInitializing the client with JedisPool:\n\n```java\nimport io.redisearch.client.Client;\nimport io.redisearch.Document;\nimport io.redisearch.SearchResult;\nimport io.redisearch.Query;\nimport io.redisearch.Schema;\n\n...\n\nClient client = new Client(\"testung\", \"localhost\", 6379);\n```\nInitializing the client with JedisSentinelPool:\n\n```java\nimport io.redisearch.client.Client;\nimport io.redisearch.Document;\nimport io.redisearch.SearchResult;\nimport io.redisearch.Query;\nimport io.redisearch.Schema;\n\n...\n\nprivate static final String MASTER_NAME = \"mymaster\";\nprivate static final Set\u003cString\u003e sentinels;\nstatic {\n    sentinels = new HashSet();\n    sentinels.add(\"localhost:7000\");\n    sentinels.add(\"localhost:7001\");\n    sentinels.add(\"localhost:7002\");\n}\n\n...\n\nClient client = new Client(\"testung\", MASTER_NAME, sentinels);\n```\n\nDefining a schema for an index and creating it:\n\n```java\nSchema sc = new Schema()\n                .addTextField(\"title\", 5.0)\n                .addTextField(\"body\", 1.0)\n                .addNumericField(\"price\");\n\n// IndexDefinition requires RediSearch 2.0+\nIndexDefinition def = new IndexDefinition()\n\t\t\t\t\t\t.setPrefixes(new String[] {\"item:\", \"product:\"})\n\t\t\t\t\t\t.setFilter(\"@price\u003e100\");\n\nclient.createIndex(sc, Client.IndexOptions.defaultOptions().setDefinition(def));\n```\n \nAdding documents to the index:\n\n```java\nMap\u003cString, Object\u003e fields = new HashMap\u003c\u003e();\nfields.put(\"title\", \"hello world\");\nfields.put(\"state\", \"NY\");\nfields.put(\"body\", \"lorem ipsum\");\nfields.put(\"price\", 1337);\n\n// RediSearch 2.0+ supports working with Redis Hash commands\ntry(Jedis conn = client.connection()){\n\tconn.hset(\"item\", fields);\n}\n```\n\n```java\n// Prior to RediSearch 2.0+ the addDocument has to be called\nclient.addDocument(\"item\", fields);\n```\n\nSearching the index:\n\n```java\n// Creating a complex query\nQuery q = new Query(\"hello world\")\n                    .addFilter(new Query.NumericFilter(\"price\", 0, 1000))\n                    .limit(0,5);\n\n// actual search\nSearchResult res = client.search(q);\n\n// aggregation query\nAggregationBuilder r = new AggregationBuilder(\"hello\")\n  .apply(\"@price/1000\", \"k\")\n  .groupBy(\"@state\", Reducers.avg(\"@k\").as(\"avgprice\"))\n  .filter(\"@avgprice\u003e=2\")\n  .sortBy(10, SortedField.asc(\"@state\"));\n  \nAggregationResult res = client.aggregate(r);\n```\n\n---\n \n### Also supported:\n\n* Geo filtering\n* Exact matching\n* Union matching\n* Stemming in 17 languages\n* Deleting and updating documents on the fly\n* And much more... See [https://oss.redislabs.com/redisearch/](https://oss.redislabs.com/redisearch/) for more details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredisearch%2Fjredisearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredisearch%2Fjredisearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredisearch%2Fjredisearch/lists"}