dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Search bug

Open yovanoc opened this issue 1 year ago • 11 comments

I know you just add support for search but I thought reporting you this can help.

When we follow the example here https://redis.io/docs/interact/search-and-query/indexing/

this command return nothing:

127.0.0.1:6379> FT.SEARCH itemIdx '@description:(bluetooth headphones) @price:[0 70]'
1) (integer) 0

json arrays as tag doesn't work too, and json arrays as text gives syntax error

yovanoc avatar Oct 06 '23 09:10 yovanoc

Hi! 👋🏻 Thanks for the report. True, also numeric arrays can be indexed as multi-value entries. Will fix that soon

dranikpg avatar Oct 06 '23 11:10 dranikpg

The debug memory command will be very useful too

yovanoc avatar Oct 07 '23 11:10 yovanoc

And JSON.MSET . Where can we see your plans on implementing or not things ?

yovanoc avatar Oct 14 '23 19:10 yovanoc

@yovanoc if there is no issue then we unlikely implement it. Please open an issue for json.mset.

romange avatar Oct 15 '23 04:10 romange

CleanShot 2023-10-15 at 19 25 43

I get crashes on simples

FT.CREATE myIdx ON JSON PREFIX 1 thepath- SCHEMA $.the.deep.key AS theKey NUMERIC
FT.SEARCH myIdx '@theKey:(1)'

yovanoc avatar Oct 15 '23 17:10 yovanoc

  1. #2015 will fix the original issue with numbers, I will follow up with json arrays afterwards
  2. What version of Dragonfly are you using? Please use only the latest version (or even better the main branch though it can be a little bumpy) image Also, please use only the range type query for numerics for now image
  3. I'm really interested what you're using search for? Just experimenting or some kind of project 🙂 I'm open to hearing any complains about missing features, performance and of course bugs. All of this helps us to improve the feature before officially launching it

dranikpg avatar Oct 15 '23 20:10 dranikpg

CleanShot 2023-10-16 at 10 45 08

1.10 so the last apparently but it still crashes

but thanks for advices I will use ranges for now, and my use case is a big microservices project in cybersecurity that need to search through CVA etc

yovanoc avatar Oct 16 '23 08:10 yovanoc

@yovanoc

We released 1.11 today and it should contain some fixes 🔥 For example, there should be no easy way to crash Dragonfly at all (before I didn't expect search to have actually any users at all). The latest fixes are unfortunately not included in this issue

dranikpg avatar Oct 16 '23 14:10 dranikpg

Will look at it very soon! 🔥

yovanoc avatar Oct 17 '23 12:10 yovanoc

@yovanoc

..before I didn't expect search to have actually any users at all..

Of course, we are already testing the search. Ultimately, the search with Json and an index would facilitate many things and bring DragonflyDB to a whole new level. A Redis alternative without modules that can do Json, Geo and Fulltext, but is much more efficient and faster. A dream

Here is another error in the search I just found: The sorting does not work after a restart. The search field defined in the index is not found after the restart ((error) ERR Invalid sort field). Directly after creating the index it still works, after restarting the DB it doesn't work anymore.

If I could wish something for the search would be the WITHSCORES output (with the hope that the current search as in Redis by default sorted by relevance) and the extension of the index with the simple GEO point search (distance) eg by definition in the index „$.location AS location GEO" and then FT.SEARCH searchIdx "@title Linux @location:[-0.441 51.458 1 km]". We run an IT job search that searches by job title and distance. This would be great.

Much you have already finished: The most important FT-commands (info, drop, etc). Also Limit works well, the search in tags we have tested so far only with numeric arrays values, so we had not noticed the error above until now.

FT.SEARCH searchIDS "@tags:{972739643}" with numeric Json Array [972739643, 972739641, 972739670,..] with "$.tags.* AS tags TAG" works for us. Thanks for the bug report. If the SORT BY field works after the restart we will test further :-)

admtech avatar Oct 24 '23 00:10 admtech

@admtech

Hi! Happy to see courageous users ready to try out brand new features 😀

  1. I just fixed the persistence bug, now SORTABLE NOINDEX should be correctly serialized in snapshots. I'll trigger a docker build, by the end of this day it should be available on ghcr.io/dragonflydb/dragonfly-weekly (please note that's the main branch version, it can be a little bit bumpy)

  2. We currently do not have GEO commands implemented in Dragonfly, once we do it can be made possible. Scoring is an important feature, but really requires some effort to implement

  3. It might work for tags, but rightfully noted it doesn't for all field 🙂 Will be fixed

Feel free to reach out about any issues you encounter

dranikpg avatar Oct 25 '23 11:10 dranikpg