In this chapter, we will cover the following topics:
Understanding and using the Lucene query language
Using position-aware queries
Using boosting with autocomplete
Phrase queries with shingles
Handling user queries without errors
Handling hierarchies with nested documents
Sorting data on the basis of a function value
Controlling the number of terms needed to match
Affecting document score using function queries
Using simple nested queries
Using the Solr document's query join functionality
Handling typos with n-grams
Rescoring query results
Introduction
Creating a simple query is not a hard task, but creating a complex one, with faceting, local params, parameter dereferencing, and phrase queries can be a challenging task. Other than this, you must remember to write your query while keeping the performance factors in mind. This is why something that is simple at first sight can turn into something more challenging, such as writing a good, complex query. This chapter will try to guide you through some of the tasks you might encounter during your everyday work with Solr.