solr

Django-Haystack with Solr contains search

孤街醉人 提交于 2019-12-18 12:34:08
问题 I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...") The __startswith option does not suit our needs as it, as the name suggests, looks for words that start with the string. I tried to use something like *keyword* but Solr does not allow the * to be used as the first character Thanks. 回答1: To get "contains" functionallity you can use: <tokenizer class="solr

SolrException: Internal Server Error

余生长醉 提交于 2019-12-18 12:26:47
问题 I am working on Solr in my application. I am using apache-solr-solrj-1.4.0.jar . When I try to call add(SolrInputDocument doc) from CommonsHttpSolrServer , I am getting the following exception: org.apache.solr.common.SolrException: Internal Server Error Internal Server Error at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:424) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243) at org.apache.solr

solr中文分词

自作多情 提交于 2019-12-18 12:24:35
solr分词,就是solr配置的字段类型根据注册的分词文件分词断句的行为。 例如:你们村村通工程知道吗? 不分词的时候会是这样: 分词的话,我们把“村村通工程 ”名词化,分词结果为: 说说中文分词 中文分词器有多中,常用的有 IKAnalyzer、 mmseg4j。 前者最新版本更新到2012年,所以使用的时候要注意可能版本上有不兼容的情况, 由于它是一个开源的,基于java语言开发的轻量级的中文分词工具包。从2006年12月推出1.0版开始, IKAnalyzer已经推出了4个大版本。最初,它是以开源项目Luence为应用主体的,结合词典分词和文法分析算法的中文分词组件。从3.0版本开始,IK发展为面向Java的公用分词组件,独立于Lucene项目,同时提供了对Lucene的默认优化实现。在2012版本中,IK实现了简单的分词歧义排除算法,标志着IK分词器从单纯的词典分词向模拟语义分词衍化 。 使用方法,需要下载相应的jar、配置文件, 我这里分享了一个链接 。 将ik的相关文件 拷贝到 solr工程的lib目录,配置 schema.xml 文件, 同时,把需要分词的字段,设置为text_ik,: <!-- 需要分词的字段 --> <field name="content" type="text_ik" indexed="true" stored="true" required=

Python memory footprint vs. heap size

主宰稳场 提交于 2019-12-18 11:32:40
问题 I'm having some memory issues while using a python script to issue a large solr query. I'm using the solrpy library to interface with the solr server. The query returns approximately 80,000 records. Immediately after issuing the query the python memory footprint as viewed through top balloons to ~190MB. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8225 root 16 0 193m 189m 3272 S 0.0 11.2 0:11.31 python ... At this point, the heap profile as viewed through heapy looks like this:

How to use mongoDB with Solr?

天大地大妈咪最大 提交于 2019-12-18 10:57:31
问题 Is it possible to replicate data from mongoDB to Solr? I'm using ruby + sinatra + mongoid. Or i need to make hooks with after_create, after_update and so on through rsolr? 回答1: 10gen introduced Mongo Connector, which allows to push data into Solr (among others) http://blog.mongodb.org/post/29127828146/introducing-mongo-connector From their example: python mongo_connector.py -m localhost:27217 -t http://localhost:8080/solr 回答2: Some people integrated Solr with MongoDB with application code

Solr vs Hibernate Search - Which to choose and When?

不想你离开。 提交于 2019-12-18 10:37:12
问题 We are building an ecommerce application. We are using JAVA stack with Hibernate and Spring Framework. As with all ecommerce application, we need to build search capability into ours. So, we came across Hibernate Search and Apache Solr . Can someone list out the pros and cons of both of them so that we can select the ideal solution for Enterprise Search? 回答1: Apache Solr is mainly used for full text search: if you want to find words (singular and plurals for example) in a big set of documents

使用 Solr 构建企业级搜索服务器

做~自己de王妃 提交于 2019-12-18 10:03:58
最近因项目需要一个全文搜索引擎服务, 在考察了Lucene及Solr后,我们选择了Solr. 本文简要记录了基于Solr搭建一个企业搜索服务器的过程.网上的资料太多千篇一律,也可能版本不同,总之在参照的时候并不顺利,因此在通过官网的介绍并逐步实践的基础上,我们整理了这个文档,希望能帮助到有类似需求的大家. Solr 介绍 Solr 是一个基于Lucene技术的企业级搜索应用服务器, 运行在JVM环境中, 对外以类似webservice http模式提供接口.可简单的通过配置的形式实现一个企业级的搜索服务. 安装与部署 JDK环境配置 安装配置jdk, 并设置 JAVA_HOME 环境变量, ps: 楼主最开始使用的是1.8的版本, 也挺正常, 但后面因为在尝试导入sqlserver 2014数据库数据的时候,可能是楼主下载的mssql-jdbc.jar 包比较新的原因, 总是出现类似版本过低的提示, 便直接升级到了最新的jdk11版本. 下载Solr包及配置运行环境 去Solr官网下载程序包 ,楼主下载了最新的7.5版本 http://www.apache.org/dyn/closer.lua/lucene/solr/7.5.0 Solr 本身内置了Severlet, 故可直接运行, 当然如果不习惯,也可以将其挂在类似 tomcat 等其他Serverlet 容器下运行.

solr update specific fields rather than entire document [closed]

余生颓废 提交于 2019-12-18 09:54:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Does solr allow updating specific field rather than indexing entire document. I know solr 1.4 doesn't. Has this been implemented in newer versions? 回答1: Nope. Solr doesn't allow updating a specific field. You would need to update the document again with all the existing values and

multi values are getting stored in solr document by default in 5.x

大城市里の小女人 提交于 2019-12-18 09:52:14
问题 I am quite new to Solr and I have a schema.xml file where i have defined all the fields. But the problem here is the fields are storing as multiple values. I have tried the same in Solr 4.x and everything is working as expected. Am I missing something here? <schema name="aem-solr" version="1.5"> <field name="body" type="text_general" indexed="true" stored="true" /> <field name="description" type="text_general" indexed="true" stored="true" /> <field name="contentType" type="text_general"

I'm trying to index files in a document through SOLR and lucene..

无人久伴 提交于 2019-12-18 09:39:22
问题 as i said in the title: i am using Java, but when I run the code on Eclipse, i get the following error.. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/util/ResourceLoader at Indexer.getIndexWriter(Indexer.java:38) at Indexer.rebuildIndexes(Indexer.java:73) at SolrIndexer.main(SolrIndexer.java:23) Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.util.ResourceLoader at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java