Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search bug #1995

Open
yovanoc opened this issue Oct 6, 2023 · 11 comments
Open

Search bug #1995

yovanoc opened this issue Oct 6, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@yovanoc
Copy link

yovanoc commented Oct 6, 2023

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 yovanoc added the bug Something isn't working label Oct 6, 2023
@dranikpg
Copy link
Contributor

dranikpg commented Oct 6, 2023

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

@yovanoc
Copy link
Author

yovanoc commented Oct 7, 2023

The debug memory command will be very useful too

@yovanoc
Copy link
Author

yovanoc commented Oct 14, 2023

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

@romange
Copy link
Collaborator

romange commented Oct 15, 2023

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

@yovanoc
Copy link
Author

yovanoc commented Oct 15, 2023

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

@dranikpg
Copy link
Contributor

  1. fix(search): Use double numeric values #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

@yovanoc
Copy link
Author

yovanoc commented Oct 16, 2023

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

@dranikpg
Copy link
Contributor

dranikpg commented Oct 16, 2023

@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

@yovanoc
Copy link
Author

yovanoc commented Oct 17, 2023

Will look at it very soon! 🔥

@admtech
Copy link

admtech commented Oct 24, 2023

@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 :-)

@dranikpg
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants