Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

JEDIS/REDIS 'ON' Keyword or broken query?

$
0
0

Very new to REDIS, and having issues using JSON/Index/Query that is driving me crazy.

Example struct

public class MyType implements Serializable {{    @SerializedName("myval")    @Expose    private Integer myval;    @SerializedName("status")    @Expose    private String status;}

I am easily using redis-stack, and pushing in this class using JSON/GSON.

Problem comes when I try to query.

I have an index set up that looks like

 Schema testSchema = new Schema().addTextField("$.status",1.0); myJedis.ftCreate("STATUSINDEX",IndexOperations().setDefault(rule),testSchema);

I then insert a few json blobs, some with status="on", and others with status="OFF"

Using redisInsight/Browser, I can see my json, with status ON and OFF as set in previous.

Using redisInsight/RediSearch:If I search usingFT.SEARCH "STATUSINDEX" '@&.status:OFF'
I get the json objects with status 'OFF' as expected.

If I search usingFT.SEARCH "STATUSINDEX" '@&.status:ON'
I get nothing.

If I repeat the test, but substitute "MYON" instead of "ON" when inserting the objects, then the search:FT.SEARCH "STATUSINDEX" '@&.status:MYON'returns the expected json objects.

I must be doing something wrong, or the value 'on' is reserved??

TIA, Wayne

Tried many different tests and combinations of status types. Only seems to happen using "ON"


Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>