solr

Creating EnumType Solr using SolrJ

你说的曾经没有我的故事 提交于 2019-12-31 04:24:26
问题 I need to create a schema which will containt few enums. I'm trying to do that using SolrJ. I've found this link DefininganEnumFieldinschema but I couldn't find any examples using Schema API or SolrJ. Here is my enum: public enum Attributes { SPONSORED("sponsored"), TOP_RATED("top-rated"), GENERIC("generic"), PROMOTION("promotion"), QUICK_ORDER("quick-order"); private String value; Attributes(String value) { this.value = value; } @Override @JsonValue public String toString() { return String

Facing issue while searching on string type field

纵饮孤独 提交于 2019-12-31 03:50:26
问题 I am facing issue in Solr search. My schema is as follows <fieldType name="c_text" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> <field name="parentId" type="string" indexed="true" stored="true"/> <field name="data_s" type="c_text"

Do SOLr index size decrease after deleting documents?

我的未来我决定 提交于 2019-12-31 03:22:24
问题 I have a SOLr instance where i index a large number of documents from my client so users can search them in a web application. Because we have a large number of files and they need to search the recent ones only (90 days or so) we have a scheduled job that remove old documents from index. The problem is, the disk space is increasing about 2Gb a day, even with the deletions. Is this a normal behavior or should we do something more to keep index in a stable size? We are using a Java application

Tomcat部署Solr同步mysql数据

霸气de小男生 提交于 2019-12-30 23:15:15
官网下载solr 并解压 进入到solr-7.7.2\server\solr。拷贝solr-7.7.2\server\solr\configsets的sample_techproducts_configs目录到solr-7.7.2\server\solr,重命名core1 进入到core1\conf,创建data-config.xml,数据库要添加isdelete字段作为删除标志。 <?xml version="1.0" encoding="UTF-8" ?> <dataConfig> <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1/library_basic_v010?serverTimezone=UTC&tinyInt1isBit=false&autoReconnect=true&characterEncoding=utf8&characterSetResults=utf8" user="root" password="admin"/> <document> <entity name="core1" pk="con_id" dataSource="source" transformer="HTMLStripTransformer" query=" SELECT con_id,con

Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

為{幸葍}努か 提交于 2019-12-30 18:51:34
问题 I try Querying Solr via Solrj Here is my code public class ReadFromSolr { public static void main(String[] args) throws MalformedURLException, SolrServerException { String url = "http://localhost:8983/solr"; try{ SolrServer server = new CommonsHttpSolrServer(url); ModifiableSolrParams params = new ModifiableSolrParams(); params.set("qt", "/select"); params.set("q", "name"); QueryResponse response = server.query(params); System.out.println("response = " + response); } catch

how to parse html with nutch and index specific tag to solr?

為{幸葍}努か 提交于 2019-12-30 10:08:42
问题 i have installed nutch and solr for crawling a website and search in it; as you know we can index meta tags of webpages into solr with parse meta tags plugin of nutch.(http://wiki.apache.org/nutch/IndexMetatags) now i want to know is there any way to crawl another html tag to solr that isn't meta?(plugin or anyway) like this: <div id=something> me specific tag </div> indeed i want to add a field to solr (something) that have value of "me specific tag" in this page. any idea? 回答1: I made my

Enable CORS for tomcat applications with credentials support

和自甴很熟 提交于 2019-12-30 09:59:10
问题 I have a simple GWT application running from IIS on my server. I am trying to test HTTP requests to tomcat running on the same server. However, since both the application servers are running on different ports, my browser (chrome and firefox) treats the requests as a CORS request. To enable tomcat to accept CORS request, I updated it to Tomcat 7.0.52 and enabled the CORS filter in the global web.xml configuration. I tested this simple setup and it seems to work. Here is the code in GWT:

Solr: Filtering on the number of matches in an OR query to a multivalued field

最后都变了- 提交于 2019-12-30 06:45:10
问题 Given the following example solr documents: <doc> <field name="guid">1</field> <field name="name">Harry Potter</field> <field name="friends">ron</field> <field name="friends">hermione</field> <field name="friends">ginny</field> <field name="friends">dumbledore</field> </doc> <doc> <field name="guid">2</field> <field name="name">Ron Weasley</field> <field name="friends">harry</field> <field name="friends">hermione</field> <field name="friends">lavender</field> </doc> <doc> <field name="guid">3

Is there a size or term limit for a Solr query string when using HTTP POST?

时光总嘲笑我的痴心妄想 提交于 2019-12-30 05:56:26
问题 I'm using Java to query a Solr server for results that have IDs within a set of known IDs that I am interested in. The best way I could think to get just these results that I am interested in was to create a long query string that looks something like this: q=(item_id:XXX33-3333 OR item_id:YYY42-3445 OR item_id:JFDE-3838) I generate this String, queryString , before making my request, and there are over 1500 such ids included in the request I would eventually like to make. I am using an HTTP

Simple Solr schema problem for autocomplete

本秂侑毒 提交于 2019-12-30 05:18:09
问题 I have a very simple SQL table that I want to import into Solr but because of the features I want for search I can't determine the best schema. The user will start typing into an input box and after 3 characters it will send the request to the server and pull out the most relevant results returning the top 15 matching id and name. Table ex) id | name ---------------- 1 | boating magazines 2 | boats weekly 3 | boaters collection 4 | shipping lane 5 | ships today Search and expected return ex)