Quick Tip: Find Missing Fields in Apache Solr

by Xavier Comments: 0

I had an issue raised because of a mismatch between my document results and my facet counts. The issue is basically that there is a field that is not required and in most cases, the field is added with an empty string – which is ok as empty has a meaning. However in a few cases, the field is not added at all and this is not the expected scenario. So I needed to find out why did this happen, which means finding the document id so that it can be reviewed during indexing.

Oh well..I was tired so I ran a *:* query and got all results… too much text.

Query for all: q=*:*

Added only the two fields that I needed in the fl field so that only those fields that I needed were shown and number of rows to see them all. This was kind of slow and inconvenient.

Query for all with only required fields and all rows: q=*:*&fl=title myfacet&rows=1600

So now I remembered query for missing fields! Just use the – operator on a field name.

Query for documents with missing fields: q=-myfacet:*

Problem solved. Easy as pie!

How to Start a Development Apache Solr

by Xavier Comments: 3

I am preparing for a presentation this month on Solr and SolrNet for the Atlanta .NET User Group.  Solr 5 is already out but I will be running my demos using Solr 4.10. Now that I am starting the preparation process, it really feels so good to know that starting a local Solr is SO EASY. Check out the steps which couldn’t be easier:

– Assuming you already downloaded Solr (here if you haven’t: http://lucene.apache.org/solr/downloads.html)

– Just extract into a folder. Mine is called AtlantaSolr

– Make sure you have Java running. If unsure just type java -version

2015-06-10_2152

– Now navigate to your Solr folder, in my case C:\Dropbox\Public Speaking\AtlantaSolrSolrNet

– Type the magic words java -jar start.jar and let it load.

– Voila! Navigate to localhost:8983/solr

2015-06-10_2155

It couldn’t be easier!