Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Apache Solr for Indexing Data
  • Toc
  • feedback
Apache Solr for Indexing Data

Apache Solr for Indexing Data

By : Handiekar, Johri
1 (1)
close
Apache Solr for Indexing Data

Apache Solr for Indexing Data

1 (1)
By: Handiekar, Johri

Overview of this book

Apache Solr is a widely used, open source enterprise search server that delivers powerful indexing and searching features. These features help fetch relevant information from various sources and documentation. Solr also combines with other open source tools such as Apache Tika and Apache Nutch to provide more powerful features. This fast-paced guide starts by helping you set up Solr and get acquainted with its basic building blocks, to give you a better understanding of Solr indexing. You’ll quickly move on to indexing text and boosting the indexing time. Next, you’ll focus on basic indexing techniques, various index handlers designed to modify documents, and indexing a structured data source through Data Import Handler. Moving on, you will learn techniques to perform real-time indexing and atomic updates, as well as more advanced indexing techniques such as de-duplication. Later on, we’ll help you set up a cluster of Solr servers that combine fault tolerance and high availability. You will also gain insights into working scenarios of different aspects of Solr and how to use Solr with e-commerce data. By the end of the book, you will be competent and confident working with indexing and will have a good knowledge base to efficiently program elements.
Table of Contents (13 chapters)
close
12
Index

Relevancy boosting

Let's see how we can boost some documents in Solr. Relevancy boosting can be very helpful in e-commerce websites to promote some products. In our musicStore core, we've specified a Boolean field called sale, which will tell whether the song is available for sale or not. While showing the results to the user, we can boost the documents that have sale=true in them.

We'll need to index the sampleMusicStoreData2.csvfile to Solr, as it contains more data about songs, which is needed for this example. We can use the following command to index the file:

curl 'http://localhost:8983/solr/musicStore/update?commit=true' --data-binary @sampleMusicStoreData2.csv -H 'Content-type:application/csv'

We can now use the following URL to see the indexed documents that are available for sale and whose artistName matches Rihanna:

http://localhost:8983/solr/musicStore/select?q={!boost%20b=sale}artistName:Rihanna&wt=json&indent=true&fl=id,songName...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete