solr

Installing solr and indexing mysql

烈酒焚心 提交于 2019-12-22 09:57:57
问题 Can anyone help me with Installation of solr and configuring it to mysql table.I Have tried almost all tutorials , i tried with Jetty , also tomcat.Still getting errors like Data Handler not defined or could not find solr.It's been a week , i am trying all day 回答1: In order to get solr running, (assuming that you've downloaded solr and extract it to a location), just navigate to the jetty folder. Under that there should be a start.jar . Just type in java -jar start.jar - this should start

Solr search with array of values on field

荒凉一梦 提交于 2019-12-22 09:09:21
问题 I'm new in Solr search. Can anyone help me for solr my problem. I have array of values and I want to add this in solr query like $query->setQuery('field:[1,2,5]'); When I'm executing this then I get this error message org.apache.solr.search.SyntaxError: Cannot parse 'tag_id:[1,2,5]': Encountered \" \"]\" \"] \"\" at line 1, column 13.\r\nWas expecting one of:\r\n \"TO\" ...\r\n <RANGE_QUOTED> ...\r\n <RANGE_GOOP> ...\r\n I'm stuck on this. Please help me. 回答1: try with filter query https:/

Solr suggest - How to define solr suggest as case insensitive

妖精的绣舞 提交于 2019-12-22 08:31:02
问题 My suggest (spellchecker) is returning case sensitive answers. (I use it to autocomplete - dog and Dog return different phrases)\ my suggest is defined as follows - in solrconfig - <searchComponent class="solr.SpellCheckComponent" name="suggest"> <lst name="spellchecker"> <str name="name">suggest</str> <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> <str name="field">suggest</str> <!-- the

Where did BaseTokenFilterFactory go in Solr 4.0?

我的未来我决定 提交于 2019-12-22 08:27:18
问题 The Solr documentation for creating your own token and character filters says the following. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Specifying_an_Analyzer_in_the_schema If you want to use custom CharFilters, Tokenizers or TokenFilters, you'll need to write a very simple factory that subclasses BaseTokenizerFactory or BaseTokenFilterFactory, something like this... public class MyCustomFilterFactory extends BaseTokenFilterFactory { public TokenStream create(TokenStream

How I find empty Solr document fields with lucene query

荒凉一梦 提交于 2019-12-22 08:15:51
问题 i have some documents like this: <doc> <str name="navTitle"/> <str name="title">Word 1</str> </doc> <doc> <str name="navTitle">Word 2</str> <str name="title">Word 3</str> </doc> and i will find all documents with an emtpy "navTitle" field! How is the lucene query for this? I trying " navTitle:'' " and I trying " navTitle:' ' ", but the Solr Admin Panal find nothing. Whats wrong at the query? 回答1: In the SolrQuerySytax page they says that you can use the following query to find all empty

Add and update data to Solr-4.3.0 using node module solr-client

末鹿安然 提交于 2019-12-22 08:15:31
问题 Let me take an example to explain the scenario. Suppose i have data indexed to Solr as : { "id" : "872919092", "filename" : "science_book", "path" : "/local/abc/" } Now i want to modify the data already indexed to Solr with id : 872919092 . I need to change the filename : science_book with filename : history_book and add new attribute topic : mughal to the same indexed data keeping path unchanged. I do not want to pass the path again as there is no change in that and already indexed to Solr.

Using Solr from Scala/ Play

大憨熊 提交于 2019-12-22 06:50:40
问题 How can use Solr from within Scala/ Play? Specifically how do I add/ update documents? 回答1: Update: see my newer answer refer https://stackoverflow.com/a/17315047/604511 Here is code I wrote which uses Play's JSON library and Dispatch HTTP client. Its not perfect, but it should help you get started. package controllers import play.api._ import play.api.mvc._ import play.api.libs.json.Json import play.api.libs.json.Json.toJson import dispatch._ object Application extends Controller { def index

Best Practice of Field Collapsing in SOLR 1.4

允我心安 提交于 2019-12-22 06:47:40
问题 I need a way to collapse duplicate (defined in terms of a string field with an id) results in solr. I know that such a feature is comming in the next version (1.5), but I can't wait for that. What would be the best way to remove duplicates using the current stable version 1.4? Given that finding duplicates in my case is really easy (comparison of a string field), should it be a Filter, should I overwrite the existing SearchComponent or write a new Component, or use some external libraries

Flatten nested JSON using jq

守給你的承諾、 提交于 2019-12-22 06:41:04
问题 I'd like to flatten a nested json object, e.g. {"a":{"b":1}} to {"a.b":1} in order to digest it in solr. I have 11 TB of json files which are both nested and contains dots in field names, meaning not elasticsearch (dots) nor solr (nested without the _childDocument_ notation) can digest it as is. The other solutions would be to replace dots in the field names with underscores and push it to elasticsearch, but I have far better experience with solr therefore I prefer the flatten solution

Using “terms” vs “select?qt=terms” in Solr

十年热恋 提交于 2019-12-22 06:38:18
问题 I have difficulties with the "/terms" request handler using Solr 4.2.0. Using the web browser the following url returns the list of terms of the fieldName INDUSTRY http://localhost:8983/solr/collection1/terms?terms.fl=INDUSTRY&terms.prefix=P&terms=true On the other hand, the following query returns no terms: http://localhost:8983/solr/collection1/select?qt=terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true My question is how can I use the "/terms" requestHandler via the "/select"