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 item type Phrase during LuceneCheck #94

Closed
SleepyMorpheus opened this issue Mar 27, 2023 · 1 comment
Closed

Unknown item type Phrase during LuceneCheck #94

SleepyMorpheus opened this issue Mar 27, 2023 · 1 comment

Comments

@SleepyMorpheus
Copy link

Hi,
When running the script below, i expect the LuceneCheck to report no error as the query is (as far as I can tell) supported by the lucene standard.

from .parser import parser
from .check import LuceneCheck
from .tree import SearchField, Phrase

query1 = (SearchField("f", Phrase('"Foo Bar"')))
check = LuceneCheck()
print(repr(query))
print(check.errors(query))

But I am presented with the following error

['Unknown item type Phrase : "Foo Bar"']

I couldn't find any check_phrase function in the LueceneCheck class in the check.py file. Is this intended or how could this be fixed? My guess would be to add something like the following to allow phrases but I'm really not sure about this. Any recommendations or ideas?

def check_phrase(self, item, parents):
        if not item.value.endswith('"') or not item.value.startswith('"'):
            yield "Phrase value must start and end with double quote"
@SleepyMorpheus
Copy link
Author

whoops, duplicated

@SleepyMorpheus SleepyMorpheus closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
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

1 participant