
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
com.redislabs:jredisearch
Advanced tools
A Java Client Library for RediSearch
This project contains a Java library abstracting the API of the RediSearch Redis module, that implements a powerful in-memory Secondary Index, Query Engine and Full-Text Search engine inside Redis.
JRediSearch is available using the maven central snapshot repository and via official releases.
<dependencies>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredisearch</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
and
<dependencies>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredisearch</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
Initializing the client with JedisPool:
import io.redisearch.client.Client;
import io.redisearch.Document;
import io.redisearch.SearchResult;
import io.redisearch.Query;
import io.redisearch.Schema;
...
Client client = new Client("testung", "localhost", 6379);
Initializing the client with JedisSentinelPool:
import io.redisearch.client.Client;
import io.redisearch.Document;
import io.redisearch.SearchResult;
import io.redisearch.Query;
import io.redisearch.Schema;
...
private static final String MASTER_NAME = "mymaster";
private static final Set<String> sentinels;
static {
sentinels = new HashSet();
sentinels.add("localhost:7000");
sentinels.add("localhost:7001");
sentinels.add("localhost:7002");
}
...
Client client = new Client("testung", MASTER_NAME, sentinels);
Defining a schema for an index and creating it:
Schema sc = new Schema()
.addTextField("title", 5.0)
.addTextField("body", 1.0)
.addNumericField("price");
// IndexDefinition requires RediSearch 2.0+
IndexDefinition def = new IndexDefinition()
.setPrefixes(new String[] {"item:", "product:"})
.setFilter("@price>100");
client.createIndex(sc, Client.IndexOptions.defaultOptions().setDefinition(def));
Adding documents to the index:
Map<String, Object> fields = new HashMap<>();
fields.put("title", "hello world");
fields.put("state", "NY");
fields.put("body", "lorem ipsum");
fields.put("price", 1337);
// RediSearch 2.0+ supports working with Redis Hash commands
try(Jedis conn = client.connection()){
conn.hset("item", fields);
}
// Prior to RediSearch 2.0+ the addDocument has to be called
client.addDocument("item", fields);
Searching the index:
// Creating a complex query
Query q = new Query("hello world")
.addFilter(new Query.NumericFilter("price", 0, 1000))
.limit(0,5);
// actual search
SearchResult res = client.search(q);
// aggregation query
AggregationBuilder r = new AggregationBuilder("hello")
.apply("@price/1000", "k")
.groupBy("@state", Reducers.avg("@k").as("avgprice"))
.filter("@avgprice>=2")
.sortBy(10, SortedField.asc("@state"));
AggregationResult res = client.aggregate(r);
FAQs
Official client for Redis Search
We found that com.redislabs:jredisearch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.