I am working in a project that sounds like heaven to me. Big company, hundreds of developers, latest technology all around, totally agile and the search is done with Solr and a REST API in C# which of course uses SolrNet (who would think otherwise?) In any case, spellcheck was enabled and this wreaked havoc whenever servers were rebooted. It seems like SolrCloud has an issue with spellchecking . The problem is that setting spellcheck in /select request handler makes Solr spin its wheels for a long time while starting, and it has been tracked inhttps://issues.apache.org/jira/browse/SOLR-6679. The recommended workaround is to have spell check set up in a different request handler. But here is the problem. In SolrNet you can’t easily explicitly specify the request handler. It basically uses /select. The request handler is specified via the Handler property in ISolrQueryExecuter. You can see it in action here: https://github.com/mausch/SolrNet/blob/master/SolrNet/Impl/SolrQueryExecuter.cs I checked through many forums and threads to try to get to a solution and here are some of the threads I found: Changing Handler endpoint in SolrQueryExecuter? https://groups.google.com/forum/?fromgroups=#!searchin/solrnet/handler/solrnet/Kqxn68pU0uo/uG50WSxu_swJ How can I perform solrnet query in two different request handler? https://groups.google.com/forum/#!topic/solrnet/ZA-bv9dkh_0 Different request handler https://groups.google.com/forum/#!topic/solrnet/SP14XmifcrY Calling Custom Request Handler https://groups.google.com/forum/#!topic/solrnet/THX-ADS5CLQ http://stackoverflow.com/questions/13393700/how-we-changes-standard-query-handler […]
I was asked today if it makes sense to change the name of the default id field in Solr to something else? Let me explain. You download your Solr, you get it up and running and you start modifying fields in Schema.xml. Currently the uniquekey is called id and it is defined as uniquekey. No harm done in leaving as is. It looks something like what I have below. <field name=”id” type=”string” indexed=”true” stored=”true” required=”true” multiValued=”false” /> …. <uniqueKey>id</uniqueKey> At first it may seem like it doesn’t matter what it is actually called, however if you think about it a little bit more it may make sense to change it. Why? Simple. Because id, by being the default value may be used in other locations, even in sample code and it may have been used for specific purposes or in ways that you are not aware of. So by changing it, you are forcing yourself to be aware of where the id field is being used. It is not a huge difference, but the devil is in the details. Something as easy as changing it to look like this is more than enough. <field name=”itemid” type=”string” indexed=”true” stored=”true” required=”true” multiValued=”false” […]
As I mentioned in my previous post, I was having a chat with a search architect on C# and Solr and he was telling me how they were going to call Solr using its REST API, which IMHO is not the best way to go. I recommended SolrNet and I stick with this recommendation because you do not want to reinvent the wheel. SolrNet has been built over the course of several years, there are plenty of people using it and they have had the time to understand the functionality that Solr provides and code it accordingly. The problem that you will face if you implement everything via REST calls is that you need to take into consideration all possible scenarios, which in a lot of cases does not happen, And that’s when exceptions start to occur. In some cases it is not possible to use a library as there may be legal implications. But in other cases it is because of the NIH syndrome, or the not invented here syndrome. Sometimes teams prefer to have everything created in house. In my opinion that may apply pretty well if you have a closed library as you are at the mercy of […]
I was having a conversation with an solutions architect a few days ago about a specific Solr project with .NET. He was telling me some of the details of what they were going to build, how they were going to call Solr’s REST API for querying and …. Stop the press… Stop right there… I said…. You are going to call Solr’s REST API? Really? The fact that Solr has a REST API is massively useful, but why do you want to reinvent the wheel. If you want to use Solr from .NET, I explained, the best way is to use SolrNet(https://github.com/mausch/SolrNet). SolrNet is an Apache Solr client for .Net that allows for you to use Solr from .NET in a super easy and efficient way. It abstracts Solr in such an easy way that you basically just create a POCO object (Plain Old Clr Object – not to wrongly called Plain Old C# Object as many people do) and presto, you have functions to Add, Delete, Commit and more. Let me show you a small sample I built about a week ago in literally just a few minutes to index a few thousand mails from Pluralsight’s (the best online training resource available […]
Meetings are a double edge sword. On one hand they are very useful for brainstorming, communication within and between teams and in general when used appropriately it sparks collaboration; moving projects forward. The problem lies when meetings are misused or abused which sadly sometimes tends to happen more often than not. And that’s why I want to tell you 5 reasons why meetings suck and how to make them rock! #1 People use them to keep busy vs being productive: I’ve seen many times how people set up meetings because for them going to the meeting is the work. Even worse, a lot of meetings end with “let’s set up another meeting to continue the discussion”. This is very common among Project Managers or Product Managers. Just as a fun mental exercise, take a couple of minutes and think if you know a few. I do. How to deal with it: Make sure that every meeting that you attend or control over has a real and very clear objective. Even more, make sure that it is important that this meeting takes place. If the objective is not important or required, then simply defer it until it is the right time. […]
There is a phrase I use all the time: “Search is one of the most misunderstood functionalities in IT”. And I think it is very accurate. The problem lies in two different aspects: Developers don’t know how to use search engines. And it is ok, search engines can be hard to tune appropriately and it is a specialised niche. In some cases, there are some search engines which are awfully expensive. Developers are lazy. Let me explain this one. Let’s say that I am setting up an application for selling cars. Potential customers always look for the same things, which are make, model, year, sort by price and so on and so forth. There is a set of meta data that is important and required to find what you are looking for. So what is the solution to this problem? Use a database where each field is stored in a separate column and look for the fields accordingly, just like in the following image. It is a mistake or at least a UX horror. I hate database driven search, but that is just my personal opinion. The correct wat of doing it is by providing a single search box. How? Like this: If […]
I have been a fan of Microsoft technologies all my life, probably because I’ve spent a lot of time working with .Net and related technologies. Eventually I became also an Apple fanboy as some people have called me. But something that I haven’t been called a fan of is Linux. Don’t get me wrong, I think Linux is extremely important, but in my case I have not worked with it as much as I think I should have. But now I am in a part of my life where I need to run Apache Solr in a production environment. What do I do? What comes naturally. In a nutshell I set up a Windows machine in Amazon AWS, install Java, download Solr, java -jar start.jar, modify solrconfig.xml, modify schema.xml, turn around a few more knobs and test. Once I am happy I install Tomcat and voila, I have a single node for production. It is a small application with very few documents and a reasonable traffic, so it is all good. And besides, it is amazing how much a Solr instance in AWS can handle. Anyway, my need keeps growing and I believe I need to set up a more […]