solr

springboot对solr索引的增删改查

故事扮演 提交于 2019-12-24 17:43:56
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> solr版本:8.x springboot版本:1.5.6 1.准备springboot项目,pom.xml需要引入以下jar包 <properties> <project.final.name>htsolr</project.final.name> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--solr支持的版本--> <spring.data.solr.version>2.1.1.RELEASE</spring.data.solr.version> </properties> <!--solr支持的版本--> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-solr</artifactId> </dependency> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.data</groupId> <artifactId

Lucene term boosting with sunspot-rails

南笙酒味 提交于 2019-12-24 17:25:17
问题 I'm having an issue with Lucene's Term [Boosting][1] query syntax, specifically in Ruby on Rails via the sunspot_rails gem. This is whereby you can specify the weight of a specific term during a query, and is not related to the weighting of a particular field. The HTML query generated by sunspot uses the qf parameter to specify the fields to be searched as configured, and the q parameter for the query itself. When the caret is added to a search term to specify a boost (i.e. q=searchterm^5) it

docker安装solr

纵饮孤独 提交于 2019-12-24 17:24:06
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Solr是一个独立的企业级搜索应用服务器,solr是以lucene为内核开发的企业级搜索应用 应用程序可以通过http请求方式来提交索引,查询索引,提供了比lucene更丰富的查询语言,是一个高性能,高可用环境全文搜索引擎 查看solr版本 docker search solr 下载solr(注意版本) docker pull solr:5.5.5 下载镜像成功然后进入下一步 安装solr 在页面可以看到该命令,该命令使用的是端口映射但是我要使用仅主机模式所以输入命令 docker run --name my_solr -idt --net host solr:5.5.5 完成后输入查看容器命令: docker ps -a 得到下图表示已经在后台运行 它会默认开辟一个8983的端口 创建core : docker exec -it --user=solr my_solr bin/solr create_core -c mycore 命令解析: --user=solr 用默认启动容器自动创建solr用户执行命令 -c mycore -c=命名,mycore=名称 也可以用这种http网页创建(比较底层的东西) http://localhost:8983/solr/admin/cores?action=CREATE

Solr: Retrieve non-stored fields from external data source

旧城冷巷雨未停 提交于 2019-12-24 16:16:50
问题 I'm currently working on a project on which I would like to index several data sources (Oracle and HBase) into Solr for full text search. Additionally, I want to be able to visualize the data I index into Solr. I'm still evaluating on whether to use Banana or Hue for this. Here comes the problem: As far as I understood the Solr docs, I can only search on indexed, but non-stored, fields, but not retrieve their original contents. I suppose this will make it quite difficult for the visualizers

Jetty Logs Location

余生长醉 提交于 2019-12-24 16:12:58
问题 I am working on Solr and using Jetty. Now in logs folder in Solr home I see Solr logs but in them I do not see IP address of the client. Are jetty logs stored somewhere else? How can I get to know the client IP address in the logs? Here is what I see in my solr logs: INFO - 2015-03-18 23:20:08.228; org.apache.solr.core.SolrCore; [collection1] webapp=/solr path=/select params={indent=true&q=michael&wt=json} hits=16618 status=0 QTime=40 回答1: What you're seeing are application logs, where, as

MySql Full text or Sphinx or Lucene or anything else?

末鹿安然 提交于 2019-12-24 15:39:15
问题 I am currently using MySql and have a few tables which i need to perform boolean search on. Given the fact my tables are Innodb type, I found out one of the better ways to do this is to use Sphinx or Lucene. I have a doubt in using these, my queries are of the following format, Select count(*) as cnt, DATE_FORMAT(CONVERT_TZ(wrdTrk.createdOnGMTDate,'+00:00',:zone),'%Y-%m-%d') as dat from t_twitter_tracking wrdTrk where wrdTrk.word like (:word) and wrdTrk.createdOnGMTDate between :stDate and

Solr: Partial email search with exact match

大兔子大兔子 提交于 2019-12-24 15:33:47
问题 I'm currently developing a search, where users need to search people by their first name, last name or their email. For the search I'm using Solr 4.0.0-ALPHA and edismax query. The problem I am having is that if a user were to search user with a partial email I would need to return only the matches that match exactly that partial email query. For example query: lastname@gmail should return only users that match "lastname@gmail". For example: firstname.lastname@gmail.com but now instead it

Sorting on multivalued field in Solr

你离开我真会死。 提交于 2019-12-24 15:33:40
问题 I know multivalued field sorting is not supported in Solr . But Is there any way we can sort multivalued field in Solr. I have two documents with field custom_code and values are as below, Doc 1 : 11, 78, 45, 22 Doc 2 : 56, 74, 62, 10 When I sort it in ascending order the order should be , Doc 2 : 56, 74, 62, 10 Doc 1 : 11, 78, 45, 22 Here Doc 2 will come first because it has smallest element 10 (which is greater that 11 of doc 1). How can we achieve this in Solr. What is the easiest way? 回答1

Auto importing of data from mysql to solr

你说的曾经没有我的故事 提交于 2019-12-24 15:32:13
问题 I want to import values from mysql to solr.. I did automatic import by calling a php script using mysql trigger. But i read that its not a good method.. Is there any other solution for importing data automatically? Can someone help me plzz... 回答1: Even though there is a built in mechanism for this very thing, Data Import Handler (DIH) , as mentioned in the other responses, I found this tool not very flexible. What I mean by this is, if I wanted to do any data massaging before indexing I could

搜索引擎选择: Elasticsearch与Solr

余生长醉 提交于 2019-12-24 15:23:48
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Elasticsearch简介 * Elasticsearch是一个实时的分布式搜索和分析引擎。它可以帮助你用前所未有的速度去处理大规模数据。 它可以用于全文搜索,结构化搜索以及分析,当然你也可以将这三者进行组合。 Elasticsearch是一个建立在全文搜索引擎 Apache Lucene™ 基础上的搜索引擎,可以说Lucene是当今最先进,最高效的全功能开源搜索引擎框架。 但是Lucene只是一个框架,要充分利用它的功能,需要使用JAVA,并且在程序中集成Lucene。需要很多的学习了解,才能明白它是如何运行的,Lucene确实非常复杂。 Elasticsearch使用Lucene作为内部引擎,但是在使用它做全文搜索时,只需要使用统一开发好的API即可,而不需要了解其背后复杂的Lucene的运行原理。 当然Elasticsearch并不仅仅是Lucene这么简单,它不但包括了全文搜索功能,还可以进行以下工作: 分布式实时文件存储,并将每一个字段都编入索引,使其可以被搜索。 实时分析的分布式搜索引擎。 可以扩展到上百台服务器,处理PB级别的结构化或非结构化数据。 这么多的功能被集成到一台服务器上,你可以轻松地通过客户端或者任何你喜欢的程序语言与ES的RESTful API进行交流。