Sometimes, it's useful to be able to narrow the collection of documents on which we are currently performing our search. It is useful to add some kind of explicit linked condition on the logical side for navigation on data, and this will also have a good impact on performance too.
It is shown in the following example:
It shows how the default search is restricted by the introduction of a fq=annunciation
condition.
The first result in this simple example shows that we obtain results similar to what we could have obtained by a simple q=annunciation
search. We will have the chance to see the differences between the two options with more detail in Chapter 5, Extending Search. Filtered query can be cached (just like facets, which we will see later), improving the performance by reducing the overhead of performing the same query many times and accessing documents from large datasets to the same group many times.
For example, in our scenario, we could define specific endpoints with a predefined filter query by author to create specific channels. In this case, instead of passing the parameters every time we could set them on solrconfig.xml
, as we will see later in the chapter.
52.14.82.217