PyLucene安装与初试
来源:互联网 发布:java都能做什么 编辑:程序博客网 时间:2024/04/30 03:07
安装
- 尝试在Windows上安装,遇到各种各样的bug,遂放弃
- 在Linux上安装,下载源码,解压缩后根据官网安装指南(http://lucene.apache.org/pylucene/install.html)进行安装
在安装中遇到了如下的问题:
1. 依赖:java jdk, ant
2. 修改MakeFile文件时,环境变量在文件中修改会出问题,需要在terminal中export所有的环境变量
3. 如果需要安装中文分词的工具(Smart Chinese Analyzer), 需要将其对应的jar包解注释,并且找到
–exclude org.apache.lucene.sandbox.queries.regex.JakartaRegexpCapabilities \
在附近加入一句:
–exclude org.apache.lucene.analysis.cn.smart.AnalyzerProfile\
参考文献:http://m.blog.csdn.net/blog/DSbatigol/14448151
初试
现在PyLucene对应的lucene的版本是4.9.0,在使用的过程中发现:
1 直接import Lucene是不能直接工作的,需要像Java的引入方式一样才可以。我觉得PyLucene基本就是在用python的语法写java的程序了。类似于:
import sys, os, lucene, threading, time from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer from org.apache.lucene.analysis.standard import StandardAnalyzer from org.apache.lucene.document import Document, Field, FieldType from org.apache.lucene.index import FieldInfo, IndexWriter, IndexWriterConfig from org.apache.lucene.store import SimpleFSDirectory from org.apache.lucene.util import Version
2 lucene的每个版本是不向下兼容的,不同版本的代码用的函数的名称可能不一样,所以需要根据安装的版本号,看相应的文档,不过直接看安装包自带的example还是比较方便快捷的。
0 0
- PyLucene安装与初试
- PyLucene安装
- PyLucene安装及使用
- pylucene安装手记
- PyLucene win版安装
- Linux安装配置Pylucene
- Linux上安装PyLucene
- Ubuntu 16.04 安装 PyLucene
- windows下boost的安装与初试
- windows下boost的安装与初试
- windows下boost的安装与初试
- 【SLAM】之ROS安装,配置与初试
- windows下boost的安装与初试
- windows下boost的安装与初试
- pylucene在python2.7下的安装
- 安装PyLucene时执行make的错误代码
- Ubuntu 安装 pylucene 踩坑还原记,并安装 SmartChineseAnalyzer
- pylucene分别安装在linux和windows(官方无Windows版的pylucene,要自编译)
- 杭电ACM1995(递推)
- 博客地址
- 有关内存的思考题
- Mach-O文件格式和程序从加载到执行过程
- 在iOS中使用手指简单画线
- PyLucene安装与初试
- 白开水-2015年年终总结
- .net 4.5 async await 简单用法
- Android开发学习之路--Activity之生命周期
- highchart 时间轴 固定起始和结束值
- GDB查看cpu占用100%
- MySql中in和exists效率
- 排序二之冒泡排序
- table数据如何通过ajax方式加载?