# Common imports:
import sys
from os import path, listdir
from org.apache.lucene.document import Document, Field, StringField, TextField
from org.apache.lucene.util import Version
from org.apache.lucene.store import RAMDirectory
from datetime import datetime
# Indexer imports:
from org.apache.luce
更新问题:
谢谢法沃雷蒂!
我使用apt-get安装了jcc,而pylucene下的makefile运行了一点点,并抛出了一个java错误,我一点也不知道。这就是了。你能告诉我这是什么错误吗?
While loading org/apache/pylucene/search/PythonIntParser
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, l
我想在PyLucene中编写一个自定义的相似类来实现我自己的检索模型。
通常,使用Lucene的java版本,您必须扩展相似类并重写方法。例如:
public class IDFSimilarity extends TFIDFSimilarity {
/** Sole constructor: parameter-free */
public IDFSimilarity() {
}
/** Implemented as <code>overlap / maxOverlap</code>. */
@Override
public float coord(int ove
我正在尝试安装JCC (作为安装PyLucene的一部分),并且遇到了一些问题。我使用的python版本是3.7,我使用brew木桶安装了佐普敦use 8.jdk(因为在没有特定许可的情况下,Java-8不再可用(请在某个地方阅读))。在这不起作用之后,我手动安装了Java-8
在shell中运行setup.py (使用java8或采用java8)时,我收到的错误是:
OSError: warning: [options] bootstrap class path not set in conjunction with -source 5
error: Source option 5 is
使用最新的,我遵循了幽门烯的安装指南pylucene-4.9.0.0。
当我尝试lucene.initVM()时,我得到以下错误:
alvas@ubi:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lucene
>>> lu
因此,我试图在PyLucene中实现一个基本的索引编写器。我通常是一个java,但是由于技术上的限制,我在python中这样做,否则就不会有问题了。我正在遵循PyLucene Tarball中的示例,但是
import lucene
from java.io import File
from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.document import Document, Field
from org.apache.lucene.index import I
我已经安装了PyLucene的源代码,其中包含JCC源代码。当尝试在JCC目录中运行python setup.py build时,我收到以下错误: Java JDK directory 'c:/Program Files/Java/jdk1.6.0_18' does not exist. Please set the environment variable JCC_JDK to the correct location before running setup.py. 有人能帮我设置正确的环境变量吗?
我围绕一个使用pylucene (6.5)读取和查询Lucene索引的类构建了一个简单的包装器服务。运行服务器时出现以下错误:
RuntimeError: attachCurrentThread() must be called first
我假设问题源于lucene.initVM()语句,并且我尝试将其移动到不同的位置。如果我把它放在request方法中,它就会起作用,但这意味着我需要在每次请求时加载索引。
有没有更好的方法呢?
您好,我正在尝试将Pylucene安装在我运行在Snow Leopard上的32位python上。我成功地编译了JCC。但我在生产木聚烯的时候收到警告:
ld: warning: in build/temp.macosx-10.6-i386-2.6/build/_lucene/__init__.o, file is not of required architecture
ld: warning: in build/temp.macosx-10.6-i386-2.6/build/_lucene/__wrap01__.o, file is not of required architecture