Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Solr Cookbook - Third Edition
  • Toc
  • feedback
Solr Cookbook - Third Edition

Solr Cookbook - Third Edition

By : Rafal Kuc
3.8 (6)
close
Solr Cookbook - Third Edition

Solr Cookbook - Third Edition

3.8 (6)
By: Rafal Kuc

Overview of this book

This book is for intermediate Solr Developers who are willing to learn and implement Pro-level practices, techniques, and solutions. This edition will specifically appeal to developers who wish to quickly get to grips with the changes and new features of Apache Solr 5.
Table of Contents (12 chapters)
close
11
Index

Avoiding caching of rare filters to improve the performance


Imagine that some of the filters you use in your queries are not good candidates for caching. You might wonder why—for example, do those filters have date and time with seconds or are spatial filters scattered all over the world? Such filters are quite unique, and thus when they are put into the cache, they are very rarely reused and thus they are more or less useless. Caching such filters is a waste of memory and CPU cycles. Is there something you can do to avoid filter queries caching? Yes, there is a way, and this recipe will show you how to do it.

How to do it...

Let's assume we have the following query being used to get the information we need:

q=solr+cookbook&fq=category:books&fq=date:[2014-06-12T13:22:12Z+TO+2014-07-11T11:24:54Z]

The filter query we don't want to cache is the one filtering our documents on the basis of the date field. Of course, even though we don't want that filter to be cached, we still want the filtering...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete