search
Homephp教程php手册Drupal 7结合Apache Solr 4.7实现中文分词教程

Solr是一个高性能,采用Java5开发,基于Lucene的全文搜索服务器。同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置、可扩展并对查询性能进行了优化,并且提供了一个完善的功能管理界面,是一款非常优秀的全文搜索引擎。

Solr的版本升级较快,目前已经到5.x的版本,但是drupal的版本升级比较慢,因此关于Drupal升级使用solr高版本的问题,进展也比较慢,另外一个原因是Drupal的apachesolr模块是否支持也是一个问题,所以作者建议不要盲目的升级使用高版本,一定要测试之后才能在正式服务器上使用。

 

Drupal 7结合Apache Solr 4.7实现中文分词教程

 

这次是参考网上的一些教程,把Apache Solr整合了中文分词,然后配合了Drupal的schema设置步骤,已经添加了自定义的中文分词器,对Drupal7以及中文分词做了支持。

Solr4.x增加了collection的概念,其实collection就是一个数据库的table的概念,这样一个core就可以有多个collection,solr的存储基本跟数据库就类似了。core等于数据库、collection等于数据表。

由于Jetty的版本不一样,导致配置文件的修改也有不同,因此jetty也做了适当修改,比如context.xml中把war文件改成了resourceBase的设置模式,以至于每次war文件解压不会覆盖work目录的修改。

第二个就是solr/drupal7/conf/solrconfig.xml文件中会引用很多相对路径的jar包文件,这些文件原本在solr- example中工作正常,但是单独拿出来就报错,因此作者把solr包里面的contrib文件夹复制到了solr(jetty)的根目录,并做了适当修改。

详细的使用还是跟之前的solr4z类似,只是这次只支持Drupal7,没办法支持Drupal6了。

#简单的启动请使用:(window/linux)

#端口号是:8983

java -jar start.jar

#使用辅助solrd (linux only)

#端口号: 8993

./solrd start #启动

./solrd startx #前端启动

./solrd stop #停止solr

Drupal里面设置url的时候,注意一下,直接使用corename/collection-name 就可以,具体参考Drupal大学这个问题:

在drupal中Solr4如何配置url?

 

Drupal 7结合Apache Solr 4.7实现中文分词教程

本文地址:

转载随意,但请附上文章地址:-)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.