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

Unknown operation when parsing inequality field groups #56

Open
borissnd opened this issue Sep 3, 2020 · 1 comment
Open

Unknown operation when parsing inequality field groups #56

borissnd opened this issue Sep 3, 2020 · 1 comment

Comments

@borissnd
Copy link

borissnd commented Sep 3, 2020

Luqum parser yields UnknownOperation when parsing inequality with a FieldGroup.

Equality with FieldGroup:

>>> a = "a:(1 OR 2)"
>>> tree = parser.parse(a)
>>> print(repr(tree))
SearchField('a', FieldGroup(OrOperation(Word('1'), Word('2'))))

Inequality with FieldGroup:

>>> a = "a:>(1 OR 2)"
>>> tree = parser.parse(a)
>>> print(repr(tree))
UnknownOperation(SearchField('a', Word('>')), Group(OrOperation(Word('1'), Word('2'))))

Expected result:

SearchField('a', FieldGroup(OrOperation(Word('>1'), Word('>2'))))
@alexgarel
Copy link
Member

Hello @borissnd

You're right it's not supported right now. We would have to change the lexer and the grammar to support it.

Feel free to propose to make a PR with test coverage.

Sorry for, on my side I wan't be able to work on this before at least one month.

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

2 participants