Chapter 7. Performing queries and handling results

 

This chapter covers

  • Uncovering Solr’s capabilities through its numerous request handlers
  • Enhancing search results with Solr’s pluggable search components
  • Combining query parsers for powerful query capabilities
  • Returning query results including both static and dynamic values
  • Sorting results by values, functions, and relevancy
  • Debugging search results

In the previous two chapters, we covered many of the indexing and text analysis capabilities in Solr. As you saw, text analysis is something that takes place both when indexing and when running queries, though our primary focus in the last two chapters was on processing text content into the inverted index for subsequent searching. In this chapter, we will switch tracks somewhat and dive more into the query-side capabilities Solr provides.

This chapter will reintroduce the concepts of request handlers (first discussed in chapter 4), setting the context for discussing SearchHandler, Solr’s most important request handler. SearchHandler runs one or more SearchComponents, including QueryComponent, which is responsible for executing the main query on a search request. In the process of discussing QueryComponent, we’ll also introduce the many query parsers available in Solr, demonstrating the powerful query syntax and capabilities Solr provides.

7.1. The anatomy of a Solr request

7.2. Working with query parsers

7.3. Queries and filters

7.4. The default query parser (Lucene query parser)

7.5. Handling user queries (eDisMax query parser)

7.6. Other useful query parsers

7.7. Returning results

7.8. Sorting results

7.9. Debugging query results

7.10. Summary