Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Solr High Performance

You're reading from  Apache Solr High Performance

Product type Book
Published in Mar 2014
Publisher
ISBN-13 9781782164821
Pages 124 pages
Edition 1st Edition
Languages
Author (1):
Surendra Mohan Surendra Mohan
Profile icon Surendra Mohan

Documents similar to those returned in the search result


Imagine a situation where you need to search for documents that are similar to those you have searched before using some keywords and have been rendered by Solr as a search result. We will continue with our music composition e-commerce portal that we have been using for demonstration purposes. In this section, we will understand how to get similar documents (in our case, music composition) in the search result along with the result set rendered by the user while searching for a keyword.

Let us start by adding the following index structure to the fields section of our schema.xml file:

<field name="wm_id" type="string" indexed="true" stored="true" required="true" />
<field name="wm_name" type="text" indexed="true" stored="true" termVectors="true" />

We will use the following example data to work with:

<add>
  <doc>
    <field name="wm_id">wm1</field>
    <field name="wm_name">Sonata solo flute<...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}