solrnet

Solr: What are the benefits of length normalization/omitNorms=false?

China☆狼群 提交于 2019-12-03 08:32:16
问题 We're using Solr to search articles of various lengths. We index both descriptive metadata (title, author, category, keywords, etc) and the full article text. We do not boost relevance at index time - all boosts are done at query time (we use dismax, coupled with various qf, pf, and bf boosts). Currently our fulltext field uses the standard omitNorms=false; and as a result, all else equal, shorter articles (2-3 column inch articles) will frequently have higher relevance than longer feature

How to maintain state or queue of requests in Web API

放肆的年华 提交于 2019-12-03 03:21:25
问题 I have situation, where I have to receive requests in a Web API method, queue those request and then send the bulk to a database (Solr instance). I am not really sure how do I maintain a batch of requests from multiple sources. For now I am writing each request data in json format to a file on disk, Later I will have a windows service, go through the folder read all files , update the database and delete those files. Here is what I am doing in my Web API public void Post(LogEntry value) {

How to maintain state or queue of requests in Web API

六眼飞鱼酱① 提交于 2019-12-02 16:52:26
I have situation, where I have to receive requests in a Web API method, queue those request and then send the bulk to a database (Solr instance). I am not really sure how do I maintain a batch of requests from multiple sources. For now I am writing each request data in json format to a file on disk, Later I will have a windows service, go through the folder read all files , update the database and delete those files. Here is what I am doing in my Web API public void Post(LogEntry value) { value.EventID = Guid.NewGuid(); value.ServerTime = DateTime.UtcNow; string json = JsonConvert

Index the value of an Enum, not the string

无人久伴 提交于 2019-12-02 07:32:05
问题 Is it possible to index the value of an Enum instead of its string representation using Solrnet? Say I have to following enum: [Serializable] [Flags] public enum Gender { Male = 0, Female = 1 } and add a solr attribute to the Gender property of a User class: [SolrField("gender")] public virtual Gender Gender { get; set; } If I index the entity using: solr.Add(user) then it will index 'Male' as gender instead of 0. Is it possible to have it index 0 instead? Edit: I'd prefer not to add an extra

Index the value of an Enum, not the string

两盒软妹~` 提交于 2019-12-02 07:17:23
Is it possible to index the value of an Enum instead of its string representation using Solrnet? Say I have to following enum: [Serializable] [Flags] public enum Gender { Male = 0, Female = 1 } and add a solr attribute to the Gender property of a User class: [SolrField("gender")] public virtual Gender Gender { get; set; } If I index the entity using: solr.Add(user) then it will index 'Male' as gender instead of 0. Is it possible to have it index 0 instead? Edit: I'd prefer not to add an extra property for this, like Ondrej proposes. You can do this by implementing ISolrFieldSerializer . If the

Intermittent connection timeouts to Solr server using SolrNet

假装没事ソ 提交于 2019-12-02 05:53:32
问题 I have a production webserver hosting a search, and another machine which hosts the Solr search server (on a subnet which is in the same room, so no network problems). All is fine >90% of the time, but I consistently get a small number of The operation has timed out errors. I've increased the timeout in the SolrNet init to 30 seconds (!) SolrNet.Startup.Init<SolrDataObject>( new SolrNet.Impl.SolrConnection( System.Configuration.ConfigurationManager.AppSettings["URL"] ) {Timeout = 30000} ); ..

Intermittent connection timeouts to Solr server using SolrNet

本秂侑毒 提交于 2019-12-02 00:18:21
I have a production webserver hosting a search, and another machine which hosts the Solr search server (on a subnet which is in the same room, so no network problems). All is fine >90% of the time, but I consistently get a small number of The operation has timed out errors. I've increased the timeout in the SolrNet init to 30 seconds (!) SolrNet.Startup.Init<SolrDataObject>( new SolrNet.Impl.SolrConnection( System.Configuration.ConfigurationManager.AppSettings["URL"] ) {Timeout = 30000} ); ...but all that happened is I started getting this message instead of Unable to connect to the remote

Set Custom Order for Facets coming from Solr

牧云@^-^@ 提交于 2019-12-01 18:09:39
I'm using Solr for offering faceted navigation for e-commerce site. However I need to define the custom order for facets, but I didn't find how to do that in Solr. Any idea how to do this? I'm using Solr Net and latest version of Solr. Here is an example what I need to do. Current Facets Operating System Android (32) Blackberry OS (8) Windows (6) Apple iOS (6) Bada (5) Proprietary (2) Price 10001 - 20000 (42) 20001 - 25000 (12) 500 - 5000 (11) 5001 - 10000 (8) Note that it is just an example. And have many other facets. I want to display Price as the first facet, so need to order this facet

How can I sort solr result bases on dynamic fields

牧云@^-^@ 提交于 2019-12-01 14:42:26
Thanks for giving your time. I need to sort result on the basis of dynamic field. How can I do that ? when I am sorting on minimum value of some of those dynamic attribute. It's not giving correct result because my query is like &sort=min(A_160018,A_chandigarh1) Some of document having both field A_160018 and A_chandigarh1 while some document having no field and some having one either A_160018 or A_chandigarh1 for some result doc . could you help me , How can I sort for this type of dynamic field. If you do not know if the field exist, you can set a default value in case it does not exists.

SolrNet queries with boost functions

…衆ロ難τιáo~ 提交于 2019-12-01 10:59:33
I'm trying to use this library (which looks very nice) but I'm having difficulty understanding how to add extra params to my queries such as boost functions etc. How can this be done? You can use the ExtraParams property of QueryOptions to add any parameter to the Solr querystring. Example: ISolrOperations<Document> solr = ... var results = solr.Query("myquery", new QueryOptions { ExtraParams = new Dictionary<string, string> { {"bf", "recip(rord(myfield),1,2,3)^1.5"} } }); 来源: https://stackoverflow.com/questions/1577074/solrnet-queries-with-boost-functions