solrnet

Solr query syntax for array field

允我心安 提交于 2021-02-18 20:45:55
问题 How do I search within an array field? I am using solr 4.2 with default settings. I indexed a few html and pdf documents using SolrNet. Here is a sample result for such a document when I search using the admin search *:* enter code here <doc> <str name="id">2</str> <date name="last_modified">2011-12-19T17:33:25Z</date> <str name="author">name</str> <str name="author_s">name</str> <arr name="title"> <str>CALIFORNIA CODES</str> </arr> <arr name="content_type"> <str>application/pdf</str> </arr>

solr与.net系列课程(五)solrnet的使用

喜夏-厌秋 提交于 2020-05-03 17:39:06
solr与.net系列课程(五)solrnet的使用 最近因项目比较忙,所以这篇文章出的比较晚,离上一篇文章已经有半个月的时间了,这节课我们来学下一下solr的.net客户端solrnet 出处 https://github.com/mausch/SolrNet 上一篇文章讲述了C#是如何请求和接受solr的数据的,请求链接是自己拼接的,接受数据是使用数据契约,solrnet就是把这些步骤封装起来,大家直接调用方法就可以请求和接受数据 首先要下载solrnet所要使用的DLL Microsoft.Practices.ServiceLocation.dll SolrNet.dll HttpWebAdapters.dll 下载地址 http://pan.baidu.com/s/1pJt7Wr5 创建一个项目,然后引用上面的DLL 好了,下面就开始实战, 我们来设计一个查询条件 title="关键字" and (area="北京" or area="上海") and industry="电力" and columns="项目" order time desc (1)创建一个接收数据的实体类,内容如下 using System; using System.Collections.Generic; using System.Linq; using System.Web; using

Solr学习总结(五)SolrNet的基本用法及CURD

霸气de小男生 提交于 2020-05-02 07:42:17
  上一篇已经讲到了Solr 查询的相关的参数。这里在讲讲C#是如何通过客户端请求和接受solr服务器的数据, 这里推荐使用SolrNet,主要是:SolrNet使用非常方便,而且用户众多,一直都在更新,感兴趣的可以加入他们的邮件群组,方便迅速了解SolrNet的最新动态。   SorlNet源码地址: https://github.com/mausch/SolrNet   SolrNet使用说明文档: https://github.com/mausch/SolrNet/tree/master/Documentation   一、创建一个项目控制台程序,并引用SolrNet.dll。 Demo下载        注意:SolrNet 依赖HttpWebAdapters.dll和Microsoft.Practices.ServiceLocation.dll 这两个dll 文件,所以,如果编译或者测试有问题,引用这两个dll 文件应该就ok了。   二、在solr 的schema.xml 增加相关的Filed 字段,同时创建一个实体类,与schema.xml中的Filed 字段映射。    public class Product { [SolrUniqueKey( " id " )] public int id { get ; set ; } [SolrField( " name "

How do I properly do a dismax query using solrnet

十年热恋 提交于 2020-03-03 12:33:29
问题 I know I need to add the following code to change to dismax. ExtraParams = new Dictionary<string, string> { {"qt", "dismax"} } But how do I pass the "qf" values? I tried this with no avail: new Dictionary<string, string> { {"qt", "dismax"},{"qf","field1 field2"} } and var matchingItems = solr.Query(new LocalParams {{"type", "dismax"},{"qf","field1 field2"}} + BuildQuery(parameters) ... Even passing only the ExtraParams I get a 404 bad request. This is the logged queries Local parameters +

Is it possible to retrieve the field name(s) that matched the query in Solr?

六眼飞鱼酱① 提交于 2020-02-03 05:24:52
问题 I would like to dynamically show to the user which field matched the query that was sent to Solr. For example, if I had a document document field1: "yay" field2: "nay" dynamic_field_hurr_*: one: "yay" two: "nay" and i queried for "yay", would it be possible for me to know that yay was found in field1 and dynamic_field_hurr_one? I feel like I've been through the whole documentation, and thought I should use highlighting for this, but I can't get it to work on dynamic fields. On normal fields

Is it possible to retrieve the field name(s) that matched the query in Solr?

允我心安 提交于 2020-02-03 05:24:12
问题 I would like to dynamically show to the user which field matched the query that was sent to Solr. For example, if I had a document document field1: "yay" field2: "nay" dynamic_field_hurr_*: one: "yay" two: "nay" and i queried for "yay", would it be possible for me to know that yay was found in field1 and dynamic_field_hurr_one? I feel like I've been through the whole documentation, and thought I should use highlighting for this, but I can't get it to work on dynamic fields. On normal fields

Use different solr requesthandlers for different webpages

醉酒当歌 提交于 2020-01-17 12:26:44
问题 I am using solrnet. I have two handler. 1) /Default handler 2) /mysearch handler 1st one is used for few of webpages & 2nd one is used for other webpages. So, how can I use both of handlers for different webpages? Please advise me this is possible or not? 来源: https://stackoverflow.com/questions/29390870/use-different-solr-requesthandlers-for-different-webpages

Use different solr requesthandlers for different webpages

懵懂的女人 提交于 2020-01-17 12:26:04
问题 I am using solrnet. I have two handler. 1) /Default handler 2) /mysearch handler 1st one is used for few of webpages & 2nd one is used for other webpages. So, how can I use both of handlers for different webpages? Please advise me this is possible or not? 来源: https://stackoverflow.com/questions/29390870/use-different-solr-requesthandlers-for-different-webpages

Solr stops responding (or slows down to molasses)…(Solr newbie)

爱⌒轻易说出口 提交于 2020-01-15 03:02:32
问题 Running multi-core Solr under Tomcat 6.0 /Win 2008 Server and ASP.NET queries via SolrNet. One of the cores is huge i.e. ~25 million documents (~20 GB disk-space) and several fields. The other 3 cores are much smaller (few gigs each). After a couple of queries to the large index, Solr slows down dramatically and stops responding i.e. can't even open admin console. If I restart tomcat, things again works ok for a few more queries and then molasses to stop. I have checked the machine RAM and

SolrNet: SolrConnectionException (400) bad request when attempting to Add and Commit

我们两清 提交于 2020-01-12 09:45:06
问题 I have gotten to the point where SolrNet executes the "Add" method but when I try to "Commit" is when I receive the error. The following is my schema.xml, model, code calling it, and the error I get. Even stranger is that despite the error, the model is added to my Solr index AFTER I restart Tomcat (so it still adds my model despite the error but not immediately): schema.xml (fields and fieldtypes): <!-- Fields --> <field name="part_numbers" type="my_string_exact" indexed="true" stored="true"