Giter Site home page Giter Site logo

jredisearch's Introduction

license CircleCI GitHub issues Maven Central Javadocs Codecov Language grade: Java Known Vulnerabilities

JRediSearch

Forum Discord

A Java Client Library for RediSearch

Deprecation notice

As of jedis 4.0.0 this library is deprecated. It's features have been merged into jedis. Please either install it from maven or the repo.

Overview

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.

Installing

JRediSearch is available using the maven central snapshot repository and via official releases.

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jredisearch</artifactId>
      <version>2.0.0</version>
    </dependency>
  </dependencies>

Snapshots

  <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>

Usage example

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);

Also supported:

  • Geo filtering
  • Exact matching
  • Union matching
  • Stemming in 17 languages
  • Deleting and updating documents on the fly
  • And much more... See https://oss.redislabs.com/redisearch/ for more details.

jredisearch's People

Contributors

angelo147 avatar ashtul avatar ashutoshtripathi avatar bsbodden avatar chandu-atina avatar chayim avatar dengliming avatar dependabot[bot] avatar dragnot avatar dvirsky avatar ethanhann avatar gkorland avatar itamarhaber avatar itn3000 avatar jruaux avatar julien-boulet avatar manojjayaraman avatar mnunberg avatar mutualink avatar rnbwarden avatar sazzad16 avatar shaynativ avatar snyk-bot avatar tgrall avatar timmixell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jredisearch's Issues

testNumericFilter in ClientTest class fail

Hi,
when i run ClientTest in the imported mvn project testNumericFilter fails. Here the stacktrace:

redis.clients.jedis.exceptions.JedisDataException: Invalid numeric filter

at redis.clients.jedis.Protocol.processError(Protocol.java:128)
at redis.clients.jedis.Protocol.process(Protocol.java:162)
at redis.clients.jedis.Protocol.read(Protocol.java:216)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:310)
at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:276)
at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:281)
at io.redisearch.client.Client.search(Client.java:125)
at io.redisearch.client.ClientTest.testNumericFilter(ClientTest.java:83)

Thanks,
Manuel

Could not index geo value

While adding document to index with geo data, it generating exception with Could not index geo value value.

`
public class RedisClient {

private static final Logger LOGGER = LogManager.getLogger(RedisClient.class);
private static final ObjectMapper mapper = new ObjectMapper();
private static final String INDEX_NAME = "user";
private static final String REDIS_HOST = "localhost";
private static final int REDIS_PORT = 6379;

private final Client client;
private final Schema schema;

public RedisClient() {
    client = new Client(INDEX_NAME, REDIS_HOST, REDIS_PORT);
    schema = new Schema()
            .addTextField("CONTEXT",1.0)
            .addTextField("title", 5.0)
            .addTextField("name", 1.0)
            .addGeoField("location");
}

public static void main(String[] args) {
    RedisClient redisClient = new RedisClient();
    redisClient.createIndex();
    User user = new User();
    user.setName("name");
    user.setTitle("body");
    user.setLocation(Arrays.asList(123d, 123d));

    @SuppressWarnings("unchecked")
    Map<String, Object> docs = mapper.convertValue(user, Map.class);
    try {

        redisClient.client.addDocument(UUID.randomUUID().toString(),  docs);
    } catch (JedisDataException ex){
        LOGGER.warn(" ex);
    }
    Query query = new Query("context")
            .addFilter(new Query.GeoFilter("location", 123d,123d, 1, Query.GeoFilter.KILOMETERS));

    SearchResult res = redisClient.client.search(query);
    res.docs.stream()
            .map(Document::toString)
            .map( x -> {
                try {
                    return mapper.readValue(x, Result.class);
                } catch (IOException e) {
                }
                return x;
            })
            .forEach(System.out::println);
}

private void createIndex() {
    try {
        client.createIndex(this.schema, Client.IndexOptions.Default());
        LOGGER.info("Index " + INDEX_NAME + " has been created on redis server");
    } catch (JedisDataException ex) {
        LOGGER.warn(ex);
    }
}

}
`

Above program suppose to work, but whenever I tried to execute it create exception redis.clients.jedis.exceptions.JedisDataException: Could not index geo value.

It seems like we can't index geo attribute but i am not sure how to avoid them. Currently iam using Client.IndexOptions.Default() as indexing option which value i can use to get geo location working with redisearch.

Query re WITHPAYLOADS vs PAYLOADS

Heya; I was just reviewing deltas to look at what to update in NRediSearch, and I noticed that this commit moves from `WITHPAYLOADS" to "PAYLOADS"; however, the documentation here still says "WITHPAYLOADS". Can I query which is right? Or is this just used as a placeholder that the library detects and rewrites the args to suit?

字符串无法搜索到 (String cannot be found)

无法被搜索到
Query other = new Query("ba50c2e4-176b-4979-b700-70060f26b45e").limitFields("typeId");
SearchResult result = client.search(other);
能被搜索到
Query other = new Query("ba50c2e4").limitFields("typeId");
SearchResult result = client.search(other);
猜测“-”这个符号的问题无法被搜索到数据

NPE on MGet when key not found

I’m getting a NPE out of the Client code.

image001 (1)

I’ve created a test that sends in some good keys and a “bad” key where I know there’s no document with that key.
This corresponds to this source code :

image

It looks like null isn’t handled correctly for “items”.
Can you check this? The API docs say that items not found will be ignored. It absolutely could be that I’m using the API incorrectly, but I don’t see a negative test in your “testMGet” test case and based on what I see client-side I think this shouldn’t NPE.

Redis search client library is incompatible with redis cache

I am trying to add redis cache as well as redis search in my application but, the client libraries keep clashing and can either be enabled for redisearch or redis cache. Is there a possible solution that can be applied to have them both?

Search with special characters not giving correct result

Hi

When we are searching with special characters, its not giving correct result. For example see below results.

127.0.0.1:6379> FT.SEARCH myIdx "hello>a*"

  1. (integer) 0
    127.0.0.1:6379> FT.SEARCH myIdx "hello>ab*"
  2. (integer) 1
  3. "doc2"
    1. "title"
    2. "hello>ab"
    3. "body"
    4. "lorem ipsum"
    5. "url"
    6. "http://redis.io"

When searching for hello>a* its not returning data, but when searching hello>ab* results are returned. Could you please let us know why its not returning data.

SSL connection

Hello,
Its not a bug but more a question. How can a establish a SSL connection using JRedisearch client?

Add support for FT.GET

Hi,
I noticed the client doesn't have a way to call FT.GET. Is it possible to add an API for it?

AggregationRequest issues

In followup of the aggregation range suggestion by Kyle Davis on the RediSearch forum: https://groups.google.com/forum/#!topic/redisearch/QLECmLcDxgk
there are two issues with the AggregationRequest:

Issue 1:
To my opinion the api executing order should follow the order of the way it is constructed.

Eg:

new AggregationRequest(query)
.apply("projection", "alias1")
.apply("projection", "alias2")
.groupBy("@alias2", Reducers.count().as("alias3"))

Now this is not the case. GROUPBY is always set in the execute message before APPLY.

Issue 2:
Also in AggregationRequest.cs in the serializeRedisArgs method, I believe the rule

args.add("APPLY");

should be inside the for loop

for (Map.Entry<String, String> e : projections.entrySet()) {

in case you want to use multple APPLY actions, like in the example above.

Unsupported major.minor version 52.0

when loading client :Exception in thread "main" java.lang.UnsupportedClassVersionError: io/redisearch/client/Client : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.visionvera.ssm.util.redisearchTest.main(redisearchTest.java:24)

ClassCastException with new bulk addDocuments

When calling addDocuments with documents already in the index I get the following error:
ClassCastException: redis.clients.jedis.exceptions.JedisDataException cannot be cast to [B

jedis connection should be closed in finally block.

currently, connection is closed after a redis command is executed, this may cause a connection leak when that command is failed to execute and throws an exception. codes should be put into a try-finally block.

Term Frequencies in SearchResult

Hi,is there a way to get the frequency of the search term in each document in the search results? From the example in the reference, https://oss.redislabs.com/redisearch/java_client.html, suppose the body was the lorem ipsum lorem ipsum lorem ipsum is there a way to get how many times the word lorem was present in the document indexed - say return 3 in this case?

Let me know if I am failing to see if there is a way already to do this using JRedisearch. I am using the following dependency in the build.gradle implementation("com.redislabs:jredisearch:0.25.0")

An option to return only certain fields from a search query

Hello,

It would be great to have a way to return only certain fields from a search query. Via CLI it works using ‘ft.search index return 2 field1 field2. We can also see a way to do it in the Python api using the “return_fields” method.
That functionality can come in very handy in the Java client as well.
Thank you.
Marco

NoSuchMethodError when create index

I got below exception when trying to run the sample code in readme:

Client client = new Client("eis", "localhost", 6379);
		Schema sc = new Schema()
				.addTextField("title", 5.0)
				.addTextField("body", 1.0)
				.addNumericField("price");

		client.createIndex(sc, Client.IndexOptions.Default());
java.lang.NoSuchMethodError: redis.clients.jedis.BinaryClient.sendCommand(Lredis/clients/jedis/commands/ProtocolCommand;[Ljava/lang/String;)V
	at io.redisearch.client.Client.sendCommand(Client.java:147) ~[jredisearch-0.10.0.jar:na]
	at io.redisearch.client.Client.createIndex(Client.java:176) ~[jredisearch-0.10.0.jar:na]

My pom.xml:

		<dependency>
			<groupId>com.redislabs</groupId>
			<artifactId>jredisearch</artifactId>
			<version>0.10.0</version>
		</dependency>

My dockerfile as below:

FROM redislabs/redisearch
#COPY ./_docker/conf/redis.conf /etc/redis/redis.conf
#ENTRYPOINT ["redis-server", "/etc/redis/redis.conf", "--loadmodule", "/usr/lib/redis/modules/redisearch.so"]
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/redisearch.so"]

The module version is:

127.0.0.1:6379> module list
1) 1) "name"
   2) "ft"
   3) "ver"
   4) (integer) 10100

Thanks,

These commands take a long time, how to optimize?

Commandstats

cmdstat_ttl:calls=8,usec=32,usec_per_call=4.00
cmdstat_scan:calls=6,usec=62741,usec_per_call=10456.83
cmdstat_sadd:calls=89931,usec=670691,usec_per_call=7.46
cmdstat_FT.AGGREGATE:calls=39,usec=2427,usec_per_call=62.23
cmdstat_smembers:calls=6492346,usec=71939185,usec_per_call=11.08
cmdstat_FT.DEL:calls=658,usec=284035,usec_per_call=431.66
cmdstat_select:calls=33,usec=197,usec_per_call=5.97
cmdstat_hgetall:calls=46472001,usec=470146733,usec_per_call=10.12
cmdstat_psync:calls=2,usec=30403,usec_per_call=15201.50
cmdstat_hdel:calls=2454,usec=14804,usec_per_call=6.03
cmdstat_lpush:calls=61462,usec=309028,usec_per_call=5.03
cmdstat_set:calls=67,usec=1282,usec_per_call=19.13
cmdstat_hget:calls=2246056,usec=12474532,usec_per_call=5.55
cmdstat_memory:calls=14,usec=187791,usec_per_call=13413.64
cmdstat_hset:calls=122278,usec=1534612,usec_per_call=12.55
cmdstat_del:calls=29274,usec=190000,usec_per_call=6.49
cmdstat_sismember:calls=192789,usec=1027962,usec_per_call=5.33
cmdstat_FT.ADD:calls=13174,usec=3536154,usec_per_call=268.42
cmdstat_slowlog:calls=24,usec=2865,usec_per_call=119.38
cmdstat_type:calls=8,usec=55,usec_per_call=6.88
cmdstat_sscan:calls=8,usec=441,usec_per_call=55.12
cmdstat_ltrim:calls=5513,usec=71492,usec_per_call=12.97
cmdstat_ping:calls=12670987,usec=11490063,usec_per_call=0.91
cmdstat_zrem:calls=627,usec=13784,usec_per_call=21.98
cmdstat_exists:calls=266233,usec=1245811,usec_per_call=4.68
cmdstat_hmget:calls=1134900,usec=2170039,usec_per_call=1.91
cmdstat_hexists:calls=217658,usec=1042963,usec_per_call=4.79
cmdstat_zrange:calls=278,usec=1887,usec_per_call=6.79
cmdstat_scard:calls=8,usec=65,usec_per_call=8.12
cmdstat_expire:calls=6052,usec=19549,usec_per_call=3.23
cmdstat_srem:calls=63564,usec=162845,usec_per_call=2.56
cmdstat_zadd:calls=7439,usec=228696,usec_per_call=30.74
cmdstat_auth:calls=20567,usec=64597,usec_per_call=3.14
cmdstat_command:calls=12,usec=10349,usec_per_call=862.42
cmdstat_FT.SEARCH:calls=30932,usec=2941357,usec_per_call=95.09
cmdstat_info:calls=39,usec=16068,usec_per_call=412.00
cmdstat_replconf:calls=37577,usec=161327,usec_per_call=4.29
cmdstat_setex:calls=625,usec=14001,usec_per_call=22.40
cmdstat_get:calls=1556628,usec=7468518,usec_per_call=4.80
cmdstat_hmset:calls=74148,usec=2300661,usec_per_call=31.03
cmdstat_lrange:calls=33129,usec=327993,usec_per_call=9.90

cmdstat_FT.AGGREGATE
cmdstat_FT.DEL
cmdstat_FT.ADD
cmdstat_FT.SEARCH
These commands take a long time, how to optimize?

Fuzzy matching digits

I have defined a sortable text field in my Schema which has values that are 16-20 digits. When I try to do a fuzzy match query such as this:

Query query2 = new Query("@myNumberField:%86501%") .addFilter(new Query.NumericFilter("carrierId", 800001, 800001)) .limit(0, 20).setSortBy("myNumberField", true);

I get a stacktrace like this:

redis.clients.jedis.exceptions.JedisDataException: Syntax error at offset 13 near '86501' at redis.clients.jedis.Protocol.processError(Protocol.java:131) at redis.clients.jedis.Protocol.process(Protocol.java:165) at redis.clients.jedis.Protocol.read(Protocol.java:219) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:309) at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:276) at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:280)

What is the correct syntax for doing a fuzzy search with a string of digits?

JedisSentinelPool support in RediSearch Client

In the current implementation, as part of client initialization JedisPool is created in order to interact with Redis. My proposal is to provide support for JedisSentinelPool as well with redisearch client. User should be able to use either JedisPool or JedisSentinelPool based on their Redis Setup.

JedisSentinelPool will helps in automatic failover when master node changes from one node to another in typical Redis Master-Slave setup.

@mnunberg @itamarhaber
I'm happy to contribute for the proposal if you guys are ok with the proposal.

Tag Support

It seems that this library lacks support for tags.
I can't find a way to create a schema with tags. Searching by tags does work well, however it would also be nice to have this as part of the API rather than having to specify it in the query string.

jedisPool Exception

I created a connection:Client client = new Client(...);But watch the client,find jedisPool a Exeception:
java.lang.Exception
at org.apache.commons.pool2.impl.BaseGenericObjectPool.(BaseGenericObjectPool.java:147)
at org.apache.commons.pool2.impl.GenericObjectPool.(GenericObjectPool.java:105)
at redis.clients.jedis.util.Pool.initPool(Pool.java:45)
at redis.clients.jedis.util.Pool.(Pool.java:24)
at redis.clients.jedis.JedisPoolAbstract.(JedisPoolAbstract.java:15)
at redis.clients.jedis.JedisPool.(JedisPool.java:181)
at redis.clients.jedis.JedisPool.(JedisPool.java:145)
at redis.clients.jedis.JedisPool.(JedisPool.java:127)
at redis.clients.jedis.JedisPool.(JedisPool.java:76)
at io.redisearch.client.Client.(Client.java:68)
is this version question, please?

Error when instantiating Client: java.lang.VerifyError: Bad type on operand stack

When I instantiate the Client class I get the error below. Any idea what the cause of this is?

My setup...
Ubuntu: 16.04
Java: 1.8.0_181
JRediSearch: master branch
Jedis: 3.0.0-20180508
Pool Class: JedisPool
RediSearch: 1.4.0
Redis: 4.0.11

Error output...

2018-09-30 22:03:40,379 ERROR [io.undertow.request] (default task-43) UT005023: Exception handling request to /cqt/searchIndex.do: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    io/redisearch/client/Client.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;IILjava/lang/String;)V @28: putfield
  Reason:
    Type 'redis/clients/jedis/JedisSentinelPool' (current frame, stack[1]) is not assignable to 'redis/clients/jedis/util/Pool'
  Current Frame:
    bci: @28
    flags: { }
    locals: { 'io/redisearch/client/Client', 'java/lang/String', 'java/lang/String', 'java/util/Set', integer, integer, 'java/lang/String', 'redis/clients/jedis/JedisPoolConfig' }
    stack: { 'io/redisearch/client/Client', 'redis/clients/jedis/JedisSentinelPool' }
  Bytecode:
    0x0000000: 2ab7 0002 2a15 05b7 0003 3a07 2abb 000c
    0x0000010: 592c 2d19 0715 0419 06b7 000d b500 062a
    0x0000020: 2bb5 0007 2abb 0008 59b7 0009 b500 0ab1
    0x0000030:                                        

	at com.example.search.Index.<init>(Index.java:24)

NPE when a document field is null

With the following schema:

       Schema sc = new Schema()
                .addTextField("title", 1.0)
                .addTextField("genre", 1.0)
                .addTextField("plot", 1.0)
                .addSortableNumericField("release_year")
                .addTagField("tag")
                .addGeoField("loc");

when I try to insert some field with a null value it raises a NullPointerException

       fields = new HashMap<>();
        fields.put("title", "another title another test");
        fields.put("genre", "Action");
        fields.put("plot", null);
        fields.put("tag", null);

Proposal

  • Set the null values to "" empty String.
  • When the type is not a String for example GeoField or Numerical it will raise an clear exception

I have implemented in Document using a simple stream collector

        // replace empty value with an empty string
        this.properties = fields.entrySet()
                .stream()
                .map(e -> {
                    if (e.getValue() == null)
                        e.setValue("");
                    return e;
                })
                .collect(Collectors.toMap(
                        Map.Entry::getKey,
                        Map.Entry::getValue)
                );

BUT:

  • this breaks some test since many test are using Strings comparison, and this loop is changing the order of the field (I have not identified the exact source so far)

Questions:

  • Are you ok with the proposal?

    • another option will be to remove the empty fields, but they will not appears in the doc
  • Should I "find a way to keep" the String comparison? (not sure it is a good idea)

  • or find a way to do some more canonical test?

    • for example testing substring find "title"="hello world" and other attributes for example

Cannot initialize GeoValue

Trying to initialize a GeoValue using its contructor, i came up with the problem that GeoValue.Unit enum is not public and is needed as an argument. Also in the Values class there isnt any method to provide a GeoValue.
Am i something missing about how to create a new GeoValue or is it a bug?

Schema.TagField public access

Is there a good reason why Schema.TagField is private but Schema.TextField is public? I'd like to leverage the class directly to wrap both serialization and search functionality / syntax into a single class.

Conflict with Spring data api

This is related to issue #61. I have springboot 2.x application with spring-data-redis and jredisearch. While starting up the springboot app, i get the following error. I did try different versions of libraries, but no luck. please help

APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.data.redis.repository.configuration.RedisRepositoryConfigurationExtension.createMappingConfigBeanDef(RedisRepositoryConfigurationExtension.java:168)

The following method did not exist:

org.springframework.data.repository.config.RepositoryConfigurationSource.getRequiredAttribute(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

The method's class, org.springframework.data.repository.config.RepositoryConfigurationSource, is available from the following locations:

jar:file:/C:/Users/.m2/repository/org/springframework/data/spring-data-commons/2.1.12.RELEASE/spring-data-commons-2.1.12.RELEASE.jar!/org/springframework/data/repository/config/RepositoryConfigurationSource.class

It was loaded from the following location:

file:/C:/Users/jantony/.m2/repository/org/springframework/data/spring-data-commons/2.1.12.RELEASE/spring-data-commons-2.1.12.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.config.RepositoryConfigurationSource

Review my pull request

Please review my pull request. I am creating this ticket as my pull request was pending for long. Apologies.

#14

Missing dependencies for version 0.9.0

When including following dependency:

<dependency>
  <groupId>com.redislabs</groupId>
  <artifactId>jredisearch</artifactId>
  <version>0.9.0</version>
</dependency>

A dependency is missing: com.redislabs:jredisearch-jedis-3.0.0-sources.jar:jar:0.9.0

It cannot be found from central repository or sonatype

Schema.TagField is not SORTABLE

Is there a reason TagField does not expose a sortable constructor. It's hard-coded to false.

If not I'm happy to supply a PR for it, but wanted to ask before doing so. It appears the Lettusearch client provides for it and it looks like it should be allowed based on the documentation.

Also any plans to provide support for FT.ALTER to allow the previously created fields to be set as sortable? Lettusearch also provides this functionality which is especially useful in cases like this.

Spring Boot support

I have a Spring Boot app that currently uses lettuce to connect to Redis and takes advantage of Spring Data RedisTemplate. Connecting this application to JRedisearch is unnecessarily difficult not only because the client is currently using Jedis (thereby requiring my app to move off lettuce), but the manner in which is does is heavily protected thanks to private and default access level modifiers on methods within the Client class.

Do you have any plans to support lettuce and/or RedisTemplate, or minimally open the APIs to allow for applications access to force their own support?

why not running Jredisearch???

package redisTest;

import io.redisearch.client.Client;
import io.redisearch.Document;
import io.redisearch.SearchResult;
import io.redisearch.Query;
import io.redisearch.Schema;

public class redisearchTest {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Client client = new Client("user", "211.239.124.227",6379);	
	}
}
Exception in thread "main" java.lang.NoClassDefFoundError: redis/clients/jedis/util/Pool
	at redisTest.redisearchTest.main(redisearchTest.java:13)
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.util.Pool
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 1 more

I am using it with Jedis2.9.0.
my redis version 4.9.106 and jredisearch version 0.22.0
Jedis is works well
I dont know why not running this code.
my java version is 1.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.