coady/lupyne

ImportError: cannot import name 'spans' from 'org.apache.lucene.search' (unknown location)

gklpcsgn opened this issue · 4 comments

I'm using coady/pylucene:latest docker file and trying to import from lupyne import engine. But it gives me this error.

Traceback (most recent call last): File "/opt/project/main.py", line 1, in <module> from lupyne import engine File "/usr/local/lib/python3.11/site-packages/lupyne/engine/__init__.py", line 10, in <module> from .queries import Query # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/lupyne/engine/queries.py", line 6, in <module> from org.apache.lucene.search import spans ImportError: cannot import name 'spans' from 'org.apache.lucene.search' (unknown location)

coady commented

The last release only supports PyLucene 8; try coady/pylucene:8.

I've had trouble getting tests to pass - that is not core dump - under PyLucene 9, so I'm not sure about the future of this project. But the main branch should support PyLucene 9.1 if you want to give it a try.

I tried with coady/pylucene:8.
Now I get this error.

Traceback (most recent call last):
File "/opt/project/main.py", line 14, in
analyzer = analysis.standard.StandardAnalyzer(util.Version.LUCENE_CURRENT)
lucene.InvalidArgsError: (<class 'org.apache.lucene.analysis.standard.StandardAnalyzer'>, 'init', (<Version: 8.11.0>,))

coady commented

That error isn't in lupyne. StandardAnalyzer doesn't take a version argument (it used to).

coady commented

Just released v3.0 which supports PyLucene 9.