You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm running the following snipped to parse and check a lucene query with the luqum=0.12.1 packet.
fromluqum.parserimportparserfromluqum.checkimportLuceneCheckquery=parser.parse('size:[1 TO 10]')
check=LuceneCheck()
print(check.errors(query))
I expect there to be no error as this is a valid query as mentioned in the official documentation of elastic. But instead the LuceneCheck returns the following error:
['field expression is not valid : size:[1 TO 10]']
I therefore suspect that there might be a problem in the check.py module. Can anyone confirm my findings or is this a problem on my end?
The text was updated successfully, but these errors were encountered:
After checking out the check.py file it appears to me that the following check fails when parsing a SearchField with a Range as expr:
SIMPLE_EXPR_FIELDS= (
tree.Boost, tree.Proximity, tree.Fuzzy, tree.Word, tree.Phrase)
FIELD_EXPR_FIELDS=tuple(list(SIMPLE_EXPR_FIELDS) + [tree.FieldGroup])
# .....@_check_childrendefcheck_search_field(self, item, parents):
ifnotself._check_field_name(item.name):
yield"%s is not a valid field name"%item.nameifnotisinstance(item.expr, self.FIELD_EXPR_FIELDS):
yield"field expression is not valid : %s"%item
In my opinion the tree.Range class should be a member of FIELD_EXPR_FIELDS as it is a valid lucene statement. I have therefore added the class to the list as well as created a dedicated test called test_search_field_range.
Would this work or am I forgetting something here?
Hi,
I'm running the following snipped to parse and check a lucene query with the luqum=0.12.1 packet.
I expect there to be no error as this is a valid query as mentioned in the official documentation of elastic. But instead the LuceneCheck returns the following error:
['field expression is not valid : size:[1 TO 10]']
I therefore suspect that there might be a problem in the check.py module. Can anyone confirm my findings or is this a problem on my end?
The text was updated successfully, but these errors were encountered: