jurismarches / luqum

A lucene query parser generating ElasticSearch queries and more !
Other
188 stars 40 forks source link

Parser fails at double quote character #98

Open tehtris-siem opened 1 year ago

tehtris-siem commented 1 year ago

Hi,

I parsed the expression Category:"Logon and expected SearchField('Category', Word('"Logon')).

However i received luqum.exceptions.IllegalCharacterError.

I parsed the expression Category:Logon" and expected luqum.exceptions.IllegalCharacterError.

However i received SearchField('Category', Word('Logon"')).

from luqum.parser import parser

# No traceback
tree = parser.parse('Category:Logon"')
print(repr(tree))

# Traceback
tree = parser.parse('Category:"Logon')
print(repr(tree))

Is this an expected behavior ?

Shouldn't both expressions react in the same way ?

Is it related to this issue ? https://github.com/jurismarches/luqum/issues/86

alexgarel commented 1 year ago

Yes it might be related. I'm not sure it's easy to fix with current parser.

tehtris-siem commented 9 months ago

Hi, any update about a potential fix of this issue?

alexgarel commented 9 months ago

Sorry I don't have time to work on it personally right now (maybe at beginning of 2023.

If you want to try to tackle it, I can take the time to point you in the right direction.