Optimizing Solr to fit your needs Part 1

Let me start by saying that eZ Find is a fantastic implementation of Solr functionality. With eZ Find you get a fantastic search, out of the box. eZ Find gathers all the content in your system and organizes it for you into strings, text, and keywords (there are more but those the types I use most often). It can look at an eZ Publish keyword and know that it should thereby be a Solr keyword, again, all out of the box. There are however some serious limitations when it comes time to customize it to meet your system’s needs. Do not underestimate the power found in customizing Solr to meet your website’s needs. The default setup is great, it’s made to fit into any system with very little effort; but, just because it’s made to fit in any system does not mean that it should be used for every system.

One of the best things we could have ever done for a large Solr install was to customize a default search field. You might say, “But eZ Find already creates a default search field for you.” And you’d be right.

<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>ezf_df_text</defaultSearchField>

The thing that the default search field in eZ Find does not do, however, is get used. There is no way in eZ Find to tell it to search just one field (at least as far as I know). I did some testing in our environment, these numbers will change from system to system, but in our’s each search took almost 10 times as long to search all fields individually vs searching just 1 field. We gave eZ Find the option to search one given field, if defined, and it vastly improved our search experience.

eZ Find by default looks at all ‘searchable’ fields and adds them to either the qf (if you are using the dismax search like you should be) or it searches every searchable field individually (attr_title_t:(*:*), attr_title_s:(*:*), etc, etc, for all searchable fields). All the ‘searchable’ fields are by default added to the ezf_df_text field, so you should really do yourself a favor and search just one field, it is a noticable speed improvement, especially in large systems.

In Part 2 I will talk about how to better optimize the Solr schema.xml file using the ezf_df_text field.

Related Articles