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

allow whitespace after colon in pairs #4

Closed
deepak opened this issue Aug 8, 2014 · 4 comments
Closed

allow whitespace after colon in pairs #4

deepak opened this issue Aug 8, 2014 · 4 comments

Comments

@deepak
Copy link

deepak commented Aug 8, 2014

can we parse something like. eg.

user_name: deepak user_kind: offline

it has a space after the :

we can parse without space as of now. eg.

user_name:deepak user_kind:offline

modified the ragel file to something like

key_terminator = ':' | ': ' ;
pair = bareword % key key_terminator value ;

before looking at the forks
and found @makeitnew fork
makeitnew@c71705f#diff-ad07a259cc78956e22ff8e72d62d3925R60

it has

pair = bareword % key ':' ' '* value ;
@deepak
Copy link
Author

deepak commented Aug 8, 2014

github's search handles terms without spaces. eg. is:closed is:pr at https://github.com/bruce/keyword_search/pulls?q=is%3Aclosed+is%3Apr+

but fails if it has spaces eg. is: closed is:pr https://github.com/bruce/keyword_search/pulls?q=is%3A+closed+is%3Apr+

@eric
Copy link
Collaborator

eric commented Aug 8, 2014

I'm definitely not in favor of allowing a space after the colon. I haven't seen any similar query language that allows for that, and it just adds a lot of possible ambiguity and confusion.

@bruce
Copy link
Owner

bruce commented Aug 8, 2014

@deepak, thanks for your input on the project.

In this case I tend to agree with @eric. I'd feel differently if I've seen it in the wild -- and a cursory look at GMail's interface (notable because keyword_search was originally modeled after it) shows it has the same restriction (eg, has:attachment and has: attachment have different behaviors).

If I wanted to support this format in my own applications, I'd probably attempt to normalize user input before parsing with keyword_search; otherwise I'd try to make the expected format clear to my users as GMail does here: https://support.google.com/mail/answer/7190?hl=en

@deepak
Copy link
Author

deepak commented Aug 11, 2014

thanks @bruce and @eric
in that case, I will close this issue

I had another search query, like user_name: user_phone: user_kind:offline
here wrote a regex to clean the query
and get user_name:<none> user_phone:<none> user_kind:offline

will try something similar for this issue

@deepak deepak closed this as completed Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants