solr

Solr Custom Similarity

房东的猫 提交于 2019-12-28 03:06:09
问题 i want to set my own custom similarity in my solr schema.xml but i have a few problems with understanding this feature. I want to completely deactivate solr scoring (tf,idf,coord and fieldNorm). I dont know where to start. Things i know I have to write my own DefaultSimilarity implementation. Override the (tf,idf,coord and fieldNorm) - methods. Load the class in schem.xml Where to store the class ? Are there any working examples in the web ? I cant find one! THANKS 回答1: I figured it out on my

Solr documents with child elements?

隐身守侯 提交于 2019-12-28 03:04:35
问题 Is it somehow possible to create a solr document that contains sub-elements? For example, how would I represent something like this: <person first="Bob" last="Smith"> <children> <child first="Little" last="Smith" /> <child first="Junior" last="Smith" /> </children> </person> What is the usual way to solve this problem? 回答1: You can model this in different ways, depending on your searching/faceting needs. Usually you'll use multivalued or dynamic fields. In the next examples I'll omit the

Solr搜索应用服务器

纵然是瞬间 提交于 2019-12-27 03:31:59
一,Solr简介 1,Solr是什么 Solr是一个独立的企业级搜索应用服务器,它对外提供类似于Web-service的API接口。用户可以通过http请求,向搜索引擎服务器提交一定格式的XML文件,生成索引;也可以通过Http G SolrJ操作提出查找请求(也可以提交json格式),并得到XML格式的返回结果. 2,Solr与lucene的关系 Luncene是一套信息检索工具包,但并不包含搜索引擎系统,它包含了索引结构,读写索引工具、相关性工具(其他的搜索组件)、排序等功能,因此在使用luncene时你扔需要关注搜索引擎系统,例如数据获取、解析、分词等方面的东西。 首先solr是基于luncene做的,solr的目标是打造一款企业级的搜索引擎系统,因此它更接近于我们认识到的搜索引擎系统,它是一个搜索引擎服务,通过各种API可以让你的应用使用搜索服务,而不需要将搜索逻辑耦合在应用中。而且solr可以根据配置文件定义数据解析的方式,更像是一个搜索框架,它也支持主从(集群中的方式)、热换库(索引的数据与数据库的同步)等操作,还添加了高亮、facet(搜索组件)等搜索引擎常见功能的支持。 二,Solr环境配置 (1),Solr下载 solr安装包的下载 (2),整合Solr和tomcat Solrhome目录是Solr运行的主目录,目录中包括了运行Solr实例所有配置文件和数据文件

二、Solr安装(Tomcat)

佐手、 提交于 2019-12-26 12:00:45
安装环境 Windows 7 64bit Apache-tomcat-8.0.9-windows-x64 Solr-4.9.0 JDK 1.8.0_05 64bit 安装步骤 Tomcat和JDk的安装在这里就略过。 注意:solr4.9要求jdk1.7+ 步骤一: 解压solr-4.9.0到任意文件夹,我解压到D:\Installed Applications\solr-4.9.0\solr-4.9.0目录下。 步骤二: 将solr-4.9.0\dist\ solr-4.9.0.war复制到Tomcat webapp/目录下,最好重命名为solr.war。 步骤三: 启动Tomcat,会报错,这步只是为了将solr-4.9.0.war解压,所以手动解压放在webapp目录下面也是可行的。 步骤四: 方法一: 打开webapps\solr\WEB-INF\web.xml 找到:    <!-- <env-entry> <env-entry-name>solr/home</env-entry-name> <env-entry-value>/put/your/solr/home/here</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry> --> 这里是需要配置solr

Solr vs Lucene

倾然丶 夕夏残阳落幕 提交于 2019-12-25 22:28:51
Solr vs Lucene Solr与Lucene 并不是竞争对立关系,恰恰相反Solr 依存于Lucene,因为Solr底层的核心技术是使用Lucene 来实现的,Solr和Lucene的本质区别有以下三点:搜索服务器,企业级和管理。Lucene本质上是搜索库,不是独立的应用程序,而Solr是。Lucene专注于搜索底层的建设,而Solr专注于企业应用。Lucene不负责支撑搜索服务所必须的管理,而Solr负责。所以说,一句话概括 Solr: Solr是Lucene面向企业搜索应用的扩展。 Solr与Lucene架构图: Solr使用Lucene并且扩展了它! 一个真正的拥有 动态字段 (Dynamic Field) 和 唯一键 ( Unique Key) 的数据模式 (Data Schema) 对 Lucene 查询语言的强大扩展 ! 支持对结果进行动态的分组和过滤 高级的,可配置的文本分析 高度可配置和可扩展的缓存机制 性能优化 支持通过 XML 进行外部配置 拥有一个管理界面 可监控的日志 支持 高速增量式更新 (Fast incremental Updates) 和快照发布 (Snapshot Distribution) 更多精彩内容请关注:http://bbs.superwu.cn 关注超人学院微信二维码: 来源: https://www.cnblogs.com

No qualifying bean of type 'java.lang.Class<org.springframework.data.repository.Repository<?, ?>>'

 ̄綄美尐妖づ 提交于 2019-12-25 18:41:18
问题 Application depends on a number of spring data projects including Neo4j, Solr and Jpa. I recently had to update spring-data-solr to Snapshot-3.0.0.M1 (to eliminate another dependency conflict). I think one of the transitive dependency is causing a conflict with neo4j. If I remove spring-neo4j from project, error (see below) seem to go away. I have a attached a sample project that recreates the issue. Run Test Class AccountServiceJpaTester.testSaveAccount() Download sample project from here

Solr——配置IK分词器

依然范特西╮ 提交于 2019-12-25 17:22:11
首先需要的准备好jdk1.8和tomcat8以及ik分词器(ik分词器是5.x的版本,和solr4.10搭配的版本不一样,虽然是5.x的版本但是也是能使用在solr7.2版本上的) 分享链接https://pan.baidu.com/s/1smOxPhF 进行ik分词器的安装,打开已经解压的ik分词器文件夹 将ik-analyzer-solr5-5.x.jar复制到 apache-tomcat-8.5.24\webapps\solr\WEB-INF\lib 中 然后IKAnalyzer.cfg.xml 复制到apache-tomcat-8.5.24\webapps\solr\WEB-INF\classes中然后进入D:\solr7.2\apache-tomcat-8.5.24\solrhome\name\conf下也就是刚才新创建的core文件夹中修改managed-schema的内容在其中加上 <fieldType name="text_ik" class="solr.TextField"> <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/> </fieldType> 然后保存并重新启动服务再次访问solr主页然后按照下图的顺序进行操作,可以看见分词效果已经实现了注:在solr4.10.3中需要修改的内容的文件名为

solr exact search ignore duplicate phrase

你说的曾经没有我的故事 提交于 2019-12-25 16:42:24
问题 I'm using solr query to search the keyword from documents. I want exact Phrase to come on top but i also want if same phrase is repeated many times in document then it should be counted one because those keywords having same Phrase multiple times in document coming on top becauase getting high scoring. Please see the result below given i am searching for "php developer", two results found but both have the different scores. As per our need both should have the same score. I want to ignore the

Does HTMLStripCharFilterFactory @ Solr 3.4 strip out html for returned fields?

我怕爱的太早我们不能终老 提交于 2019-12-25 16:27:52
问题 I'm using CF10 which should be using Solr 3.4 according to corporatezen.com/2013/11/updating-solr-engine-coldfusion. I added <charFilter class="solr.HTMLStripCharFilterFactory"/> to <fieldType name="text"> but the summary field in the search result still includes HTML. Any idea why? <field name="summary" type="text" indexed="false" stored="true" required="false" /> http://localhost:8985/solr/test/admin/schema.jsp shows: Field: summary Field Type: TEXT Properties: Tokenized, Stored Schema:

Solr - How to search in all fields without passing query field?

三世轮回 提交于 2019-12-25 16:03:23
问题 I have tried as below, <field name="collector" type="text_general" indexed="true" stored="false" multiValued="true" /> and copy all my fields to copyField as below, <copyField source="fullname" dest="collector"/> <copyField source="email" dest="collector"/> <copyField source="city" dest="collector"/> and also I have put all copyField tags below <fields> </fields> tags. But I cant search in all fields. I have to pass fullname before query like, q=fullname:Mayur I want search by, q=Mayur And I