Search Within All Content Fields Using "Catchall"

Last Updated: Jan 23, 2020
documentation for the dotCMS Content Management System

The catchall search term keyword allows you to search within all searchable or indexed fields of a Content Type at once.

Example

The dotCMS starter site (and the dotCMS demo site) contain a News Content Type which has the following searchable or indexed fields:

  • Headline
  • Byline
  • Topic
  • Tags

Single Field Search

When you perform a search in the Content tab for News content with the word “gas” in the Headline field only, you receive only one result:

You can click on the Search button and then on Show Search Query to view the query used to perform the search:

Explicitly Searching Each Field

To write a standard query that includes all searchable fields, you must explicitly include both the field name and the search term for each field to be searched:

+contentType:News +(News.title:*gas* News.byline:*gas* News.topic:*gas* News.tags:*gas*)

Searching All Fields

You can simplify this by using the catchall keyword as follows:

+contentType:News +catchall:*gas*

Testing the Results

You can test the queries and verify that they produce the same results using the system Query Tool.

In the Query Tool, the original query (with each field referenced explicity) produces the following results:

The simplified query (using catchall) produces the following results:

On this page

×

We Dig Feedback

Selected excerpt:

×