Search Engine – Lucene or Solr

Lucene: Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search Solr: Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, … Read more

Solr Collection vs Cores

From the SolrCloud Documentation Collection: A single search index. Shard: A logical section of a single collection (also called Slice). Sometimes people will talk about “Shard” in a physical sense (a manifestation of a logical shard) Replica: A physical manifestation of a logical Shard, implemented as a single Lucene index on a SolrCore Leader: One … Read more

Solr filter-query vs main-query

A FilterQuery ONLY stores document IDS. This makes it very fast to apply the filter to include/exclude documents. Good examples of this are when filtering products from search based on Country, Product Type, Availability, etc. A normal query can perform the exact same function, but it has a very complex scoring system to determine “relevance”. … Read more

How to select distinct field values using Solr?

Faceting would get you a results set that contains distinct values for a field. E.g. http://localhost:8983/solr/select/?q=*%3A*&rows=0&facet=on&facet.field=txt You should get something back like this: <response> <responseHeader><status>0</status><QTime>2</QTime></responseHeader> <result numFound=”4″ start=”0″/> <lst name=”facet_counts”> <lst name=”facet_queries”/> <lst name=”facet_fields”> <lst name=”txt”> <int name=”value”>100</int> <int name=”value1″>80</int> <int name=”value2″>5</int> <int name=”value3″>2</int> <int name=”value4″>1</int> </lst> </lst> </lst> </response> Check out the wiki for … Read more

Spring Boot app: Not picking up application.properties?

This was obscure – and the other answers were very helpful in getting me pointed in the right direction. After trying the suggested solutions, I poked around deeper and found this in Project Properties –> Java Build Path –> Source(tab) –> Source folders on build path: [Exclusion section] **/application.properties Removing the exclusion fixed the issue … Read more

Why are document stores like Lucene / Solr not included in NoSQL conversations?

I once listened to an interview with author Ursula K. LeGuin about fiction writing. The interviewer asked her about authors who work in different genre of writing. What makes one author a romance writer, and another a mystery writer, and another a science fiction writer? LeGuin responded by explaining: Genre is about marketing, not about … Read more

Solr commit and optimize questions

A little more detail on Commit/Optimize: Commit: When you are indexing documents to solr none of the changes you are making will appear until you run the commit command. So timing when to run the commit command really depends on the speed at which you want the changes to appear on your site through the … Read more