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

[BUG] <Search function for convo/conversations does not work correctly> #39

Open
3 tasks done
ghost opened this issue Oct 14, 2023 · 5 comments
Open
3 tasks done
Labels
bug Something isn't working Jira This ticket is being tracked in Jira

Comments

@ghost
Copy link

ghost commented Oct 14, 2023

Code of conduct

Self-training on how to write a bug report

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Searching in "Contacts & Groups" does not work correctly.
Example, I have a contacted named "X"
I type "X" in, "X" does not show.

Expected Behavior

I have a contact named "X"
I type "X" in, and "X" does show.

Steps To Reproduce

  1. In search function
  2. Type a contact or keyword
  3. See not relevant results show

iOS Version

iOS 16.7

Session Version

2.4.3 (427)

Anything else?

No response

@ghost ghost added the bug Something isn't working label Oct 14, 2023
@KeeJef
Copy link
Collaborator

KeeJef commented Dec 5, 2023

Yeah this is a bit of an issue, we only support search for strings longer than 2 characters, otherwise things get tricky performance wise. A comprise might be to allow search for usernames / group names for less than 2 characters but still limit conversation searches. @mpretty-cyro thoughts?

@mpretty-cyro
Copy link
Collaborator

I do wonder if users will get confused as to why they aren't getting message search results when only entering a single character

I'll take a quick look so see what the performance is like for a single character search - I think the last time I actually checked were were using FTS4 (now have FTS5) and I'm not sure whether we had a limit on the search results (it's now 500 for contacts and 500 for messages)

@mpretty-cyro
Copy link
Collaborator

@KeeJef Ok did some quick testing on my main test emulator (which has quite a large database) and the results are:

Contacts & Groups

  • 2 Characters: 98ms
  • 1 Character: 263ms

Messages

  • 2 Characters: 2,408ms
  • 1 Character: 8,272ms

The query for global search is pretty complicated at the moment so this might be able to be improved (and potentially combined into a single query instead of two) but would require a decent chunk of effort so might be better left until we can move it across to libSession - I think the compromise you suggest is the best option for something sort-term

The contacts/groups search could be moved earlier than the messages, and even done in-memory instead of at the database level, but we'd need to decide whether we want to sacrifice some of the convenient things FTS5 gives us for free like matching similar words like "corrected" and "correcting" (which is probably more relevant for message searching)

@KeeJef
Copy link
Collaborator

KeeJef commented Dec 8, 2023

@mpretty-cyro sounds reasonable, lets put this in the backlog for iOS

@mpretty-cyro
Copy link
Collaborator

Jira ticket is SES-1321

@mpretty-cyro mpretty-cyro added the Jira This ticket is being tracked in Jira label Dec 10, 2023
@KeeJef KeeJef transferred this issue from oxen-io/session-ios Nov 4, 2024
@stfsession stfsession transferred this issue from another repository Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Jira This ticket is being tracked in Jira
Projects
None yet
Development

No branches or pull requests

2 participants