Let's imagine we have an e-commerce library where we put some of our books on a special promotion, for example, we give them away for free. We want to share that knowledge with our customers and say: Hey! You searched for Solr, we found this, but we also have X books that are free! To do that, we index the books that are free without the price defined. But how do you make a query to Solr to retrieve the data that we want? This recipe will show you how.
Before you start reading this recipe, please take a look at the Getting the number of documents matching the query and the subquery recipe in this chapter.