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: Respect spaces in person name in new suggestions only. #9546

Closed
wants to merge 1 commit into from

Conversation

shubham-padia
Copy link
Member

Fixes #6515.
New suggestions for sender:King ha will respect spaces and the new
suggestion will be Sent by King Hamlet <email> instead of Sent by King, search for ha. But if first term of sender operand is a valid user email,
tokens will be seperated by spaces. e.g sender:hamlet@zulip.com abc
will show Sent by King Hamlet <email>, search for abc.

selection_149

selection_148

The original issue mentioned

considering things with spaces in them if and only if the thing after the : is an exact prefix of someone's name.

I think that will not be necessary in this case as we are using only emails for filtering. If it's not an exact prefix, e.g sender:Kin ha, the prefix check would enable to make the suggestion Sent by Kin, search for ha. But since Kin is not a valid email, it's of no use and any query following it would result in empty search. The result without the prefix check would be Sent by Kin Ha. Thus, I think it's better to skip this check and (presumably) save some time. (Let me know if this needs to be changed)

Fixes zulip#6515.
New suggestions for `sender:King ha` will respect spaces and the new
suggestion will be `Sent by King Hamlet <email>` instead of `Sent by King,
search for ha`. But if first term of sender operand is a valid user email,
tokens will be seperated by spaces. e.g `sender:hamlet@zulip.com abc`
will show `Sent by King Hamlet <email>, search for abc`.
@zulipbot
Copy link
Member

Hello @zulip/server-search members, this pull request was labeled with the "area: search" label, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

Merged, thanks @shubham-padia! I think there's a broader range of low-priority similar issues that we should presumably also fix, like completing stream and topic names with a space in them.

But we might want to think about that as a broader rearchitecting of this system to have the pills structure (I think fundamentally, starting with Filter.parse won't necessarily be the right model there).

(I also think that the "Sent by king ham" top option is rarely what someone wants, and we should probably not be suggesting it as the top option)

@timabbott timabbott closed this May 25, 2018
@shubham-padia shubham-padia deleted the spacename branch September 8, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

search typeahead: Doesn't handle spaces in people's names when typing "sender:tim abbott "
3 participants