solr

Solr及Spring-Data-Solr入门学习

♀尐吖头ヾ 提交于 2019-12-20 13:28:09
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Solr的安装与配置 多数搜索引擎应用都必须具有某种搜索功能,而搜索功能往往大量的消耗资源导致应用程序运行缓慢。为此,出现了各种用于构建搜索的应用程序,我们要学习的solr正是其中的一款开源搜索平台。 Apache Solr 是建立在Lucene(全文搜索引擎)之上,帮助我从大量的数据中寻找所需信息。不仅限于搜索,Solr也可用于储存目的。像其他NoSQL数据库一样,它是一种非关系数据储存和处理技术。 <!--more--> 下面我们开始喜闻乐见的手摸手教学,教你优雅的整合SSM框架和Solr搜索框架。 项目开源地址: Github 项目中使用了SSM + Shiro + Redis + Solr + Vue.JS + ElementUI技术,优雅的整合了SSM框架阶段几个常见的企业框架;并用Vue.js + ElementUI写了超漂亮的前端页面;如果觉得可以,就点亮右上角star吧(#^.^#)。 如果你对Shiro+用户-角色-权限整合不是很懂,你或许可以看下我的这个项目: 手摸手教你SSM整合Shiro框架后的开发 。 日常学习记录,如果想支持我,希望能在Github上看到你点亮的星星(#^.^#)。 <br/> 本例中使用的Solr和Tomcat我已经上传到了Github,仓库地址:

Solr Schema Java Api 字段定义等相关操作

自古美人都是妖i 提交于 2019-12-20 13:15:46
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> import java.io.IOException; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.collections.CollectionUtils; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.CloudSolrClient; import org.apache.solr.client.solrj.request.CollectionAdminRequest; import org.apache.solr.client.solrj.request.CollectionAdminRequest.Delete; import org.apache.solr.client.solrj.request.schema.SchemaRequest;

Solr: exact phrase query with a EdgeNGramFilterFactory

淺唱寂寞╮ 提交于 2019-12-20 10:47:02
问题 In Solr (3.3), is it possible to make a field letter-by-letter searchable through a EdgeNGramFilterFactory and also sensitive to phrase queries? By example, I'm looking for a field that, if containing "contrat informatique", will be found if the user types: contrat informatique contr informa "contrat informatique" "contrat info" Currently, I made something like this: <fieldtype name="terms" class="solr.TextField"> <analyzer type="index"> <charFilter class="solr.MappingCharFilterFactory"

How to make sure Solr/Lucene won't die with java.lang.OutOfMemoryError?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 10:30:01
问题 I'm really puzzled why it keeps dying with java.lang.OutOfMemoryError during indexing even though it has a few GBs of memory. Is there a fundamental reason why it needs manual tweaking of config files / jvm parameters instead of it just figuring out how much memory is available and limiting itself to that? No other programs except Solr ever have this kind of problem. Yes, I can keep tweaking JVM heap size every time such crashes happen, but this is all so backwards. Here's stack trace of the

How to run Solr Jetty in background

你说的曾经没有我的故事 提交于 2019-12-20 09:59:45
问题 I am using the Jetty/Solr build that comes with Solr and would like to run it in the background instead of in the terminal. Right now I start it by java -jar start.jar but I would like it to log to a file and run in the background on the server so that I can close the terminal window. I'm sure there is some java config that I can't find. I have tried java -jar start.jar > log.txt & but no luck still outputs to the terminal window. Thanks. 回答1: Try something like: nohup yourcommand > output

How to fix: Error CREATEing SolrCore 'gettingstarted': Unable to create core

ぃ、小莉子 提交于 2019-12-20 09:53:45
问题 I'm getting this error when I try to create a new core in solr. root@ubuntu:/opt/solr# bin/solr create -c gettingstarted -n data_driven_schema_configs Setup new core instance directory: /var/solr/data/gettingstarted Creating new core 'gettingstarted' using command: http://localhost:8983/solr/admin/cores?action=CREATE&name=gettingstarted&instanceDir=gettingstarted Failed to create core 'gettingstarted' due to: Error CREATEing SolrCore 'gettingstarted': Unable to create core [gettingstarted]

How to filter query in solr by date?

风格不统一 提交于 2019-12-20 09:49:07
问题 In my SOLR there is date field(published_date) and values are in this format "2012-09-26T10:08:09.123Z" How I can search by simple input like "2012-09-10" instead of full ISO date format. Is it possible in SOLR?I have tried with fq=[2012-09-24%20TO%20NOW] It should return by filtering results greater than published date 2012-09-24 and less than NOW. But it returns data with published date with 2012-09-23,like below <float name="score">2.8183863</float> <str name="name">Local Team Inspires

How do I configure Solr replication with multiple cores

此生再无相见时 提交于 2019-12-20 09:44:48
问题 I have Solr running with multiple cores. Because of the heavy load, I want to set up a slave containing the exact same indexes. The documentation http://wiki.apache.org/solr/SolrReplication states "Add the replication request handler to solrconfig.xml for each core", but I only have one solrconfig.xml. My configuration: Config: /data/solr/web/solr/conf/config files Data: /data/solr/data/solr/core data dirs Is it really necessary to copy the solrconfig.xml for each core? And where should I put

Solr date field tdate vs date?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 09:32:44
问题 So I have a question about Solr's field date types which is pretty straight forward: what's the difference between a 'date' field and a 'tdate' one? The schema .xml claims that 'For faster range queries, consider the tdate type' and 'A Trie based date field for faster date range queries and date faceting. ' Fair enough... but what's the precisionStep="6" all about? should i change this? does it change the way i would create the query in case I use the tdate? What's the real advantage or what

Solr Fuzzy Search for similar words

北城余情 提交于 2019-12-20 09:20:07
问题 I am trying to do a fuzzy search for "jahngir" ~ 0.2, which does not return any results. My indexes has records with data "JAHANGIR RAHMAN MD". If I try a search with exact word "jahangir" ~ 0.2, it works. Can someone please help, on what I am doing wrong. I have spent a lot of time trying to figure out on how the Solr Fuzzy search works. Any links which explain Solr Fuzzy search would be helpful. Below is the text field that I am using for indexing. Thanks in advance. <fieldType name="text"