solr

Is it possible to get Solr's DataImportHadler to ignore fields with empty strings?

China☆狼群 提交于 2019-12-24 05:08:26
问题 I am using Solr's DataImportHandler to import data from a database. Some of the records have empty strings if there is no value for that column. Currently the configuration I have produces Solr documents like this: { "x": "value", "y": "", "z": 2 } However I would like to ignore all fields that have no value so that documents like this are created: { "x": "value", "z": 2 } Is there something I can define in the configuration file for the DataImportHandler that will give me my desired results?

Threshold frequency is not working in spell check in Solr

半世苍凉 提交于 2019-12-24 04:27:07
问题 I am get stuck in middle of Solr . I need only most popular words w.r.t query . I have used phonetic filter on both index and query but here the problem is that it is giving too many terms . I need only few terms which are very specific to the query . schema.xml <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <filter class="solr.TrimFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <tokenizer class="solr

Indexing failed. Rolled back all changes. (Solr DataImport)

岁酱吖の 提交于 2019-12-24 03:39:11
问题 When I try to run domain.com:8080/solr/dataimport?command=full-import , I get the error Indexing failed. Rolled back all changes. There's no additional error message to inform me what when wrong? Any suggestions? data-config.xml <dataConfig> <dataSource name="mysql" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/databasename" user="myusername" password="mypassword" /> <document> <entity name="posts" datasource="mysql" query="select id, title, description from posts" deltaQuery=

Searching within a subset of data - Solr

有些话、适合烂在心里 提交于 2019-12-24 03:18:14
问题 I am new to Solr (Lucene) world. What I am trying to figure out is how would I search within a subset of data? Let me elaborate: I have 10 employees in my Employee table in the database. Each employee has n number of customers that are stored in the Customers table in the same database. When an employee is searching, I want to search only within that employee's customers. This is not exactly faceted search but I am pretty sure there is a way to do it in Solr looking at all the bells and

solr: Create filter query with a function

落花浮王杯 提交于 2019-12-24 03:16:25
问题 One of the values returned by my solr query is a calculated value (using solr 4.0). The function is sum(product(2,preis12_0_3),preis34_0_3) Now I would like to filter the resultset on the values returned by the function, but I get this error: undefined field text Is it possible to filter on a function? Any pointers in the right direction appreciated. 回答1: Filter query do support function queries with FunctionRangeQParserPlugin e.g. Filter query example: fq={!frange l=0 u=2.2}sum(user_ranking

How to sort with a “nested” filter in Hybris Solr

耗尽温柔 提交于 2019-12-24 03:05:54
问题 Relationed to this post How to add Hybris Solr By for Boolean value I need to add a kind of "nested filter": when I filter with my boolean atribute isNewProduct , inside this sort , I want to sort by relevance (number indexed property) for example : I have this products: Product A : isNewProduct = true , relevance = 100; Product B : isNewProduct = false , relevance = 50; Product C : isNewProduct = true , relevance = 300; Product D : isNewProduct = false , relevance = 40; When I filter by

ToTitleCase in solr to stop SCREAMING CAPS in Solr

孤街醉人 提交于 2019-12-24 03:00:52
问题 I'm using solr's faceting and i've run into a problem that i was hoping i could get around using filters. Basically some times a town name will come through to SOLR as "CAMBRIDGE" and sometime's it will come through as "Cambridge" I wanted to use a filter in Solr to stop the SCREAMING CAPS version of the town name. It seems there is a fitler to make all the text lower case. <!-- A text field that only sorts out casing for faceting --> <fieldType name="text_facet" class="solr.TextField"

Get the result of an analysis as a JSON in SolR

梦想与她 提交于 2019-12-24 02:43:22
问题 I made a filter in SolR as following : <fieldtype name="tokenization_stopwords" class="solr.TextField" positionIncrementGap="100"> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> </analyzer> </fieldtype> When I'm using this filter in the "Analysis" section, it works. However, I'd like to be able to get the result of this analysis as a JSON. Does anyone knows how to do this ? 回答1: In

Solr——Windows下部署Solr6.6.0至Tomcat8.5.28(一)

纵饮孤独 提交于 2019-12-24 02:17:34
一、window 环境 solr 6.6.3 下载地址 http://archive.apache.org/dist/lucene/solr/ jdk 1.8 tomcat 8.5 本机tomcat环境:E:\tomcat8.5.28 本机解压路径:E:\solr6.6.3 二、部署solr 由于我在本地环境学习使用,所以下载window版本的zip包 1,首先确定安装了jdk 、tomcat、并下载了solr-6.6.3.zip 2,将solr-6.6.3.zip解压,找到E:\Java\components\solr-6.6.3\server\solr-webapp\webapp,并将webapp文件夹复制到tomcat的webapps下,并更名为solr(可以为任意名称) 3,拷贝solr-6.6.3\server\lib\ext下的jar包到tomcat下的webapps\solr\WEB-INF\lib路径下   拷贝solr-6.6.3\dist 下的solr-dataimporthandler-6.6.3.jar、solr-dataimporthandler-extras-6.6.3.jar 包到tomcat下的webapps\solr\WEB-INF\lib路径下 拷贝solr-6.6.3\server

Apache Solr schema.xml及solrconfig.xml文件中文注解

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 02:15:07
一、字段配置(schema) schema.xml位于solr/conf/目录下,类似于数据表配置文件, 定义了加入索引的数据的数据类型,主要包括type、fields和其他的一些缺省设置。 1、先来看下type节点,这里面定义FieldType子节点,包括name,class,positionIncrementGap等一些参数。 name:就是这个FieldType的名称。 class:指向org.apache.solr.analysis包里面对应的class名称,用来定义这个类型的行为。 view plaincopy to clipboardprint? Java代码 <schema name= "example" version= "1.2" > <types> <fieldType name= "string" class = "solr.StrField" sortMissingLast= "true" omitNorms= "true" /> <fieldType name= "boolean" class = "solr.BoolField" sortMissingLast= "true" omitNorms= "true" /> <fieldtype name= "binary" class = "solr.BinaryField" /> <fieldType