Search Filter Panel

The CUE search filter panel contains a set of search filters that allow users to narrow down the results of a search by limiting the results to all documents of a specified type or all documents created after a certain date, and so on. It is difficult to design a filter panel that meets all customers' requirements in this area, so the CUE search filter panel is configurable. By editing a configuration file, you can:

  • Determine which of the predefined filters supplied with CUE actually appear in the panel

  • Determine the order in which the filters appear

  • Add your own custom filters

Custom filters are simpler than the predefined filters: they are simple tests that the CUE user can only turn on or off. You could, for example, create a "Premium content" filter that selects only content items with a Boolean premium field that is set to true.

To modify the search filter panel:

  1. If necessary, switch user to root.

    $ sudo su
  2. Open /etc/escenic/cue-web-2.8/40-search-filter.yml for editing. For example:

    # nano /etc/escenic/cue-web-2.8/40-search-filter.yml
  3. Modify the default search filter layout to meet your requirements:

    searchFilter:
      - id: "document-types"
        name: "Document Types" #translate
      - id: "document-states"
        name: "Document States" #translate
      - id: "creation-date"
        name: "Creation date" #translate
      - id: "authors"
        name: "Authors" #translate
      - id: "sections"
        name: "Sections" #translate
      - id: "tags"
        name: "Tags" #translate

    You can, for example, change the order of the predefined filters and remove any you don't need by commenting them out:

    searchFilter:
      - id: "document-types"
        name: "Document Types" #translate
      - id: "document-states"
        name: "Document States" #translate
      - id: "creation-date"
        name: "Creation date" #translate
      - id: "sections"
        name: "Sections" #translate
      - id: "authors"
        name: "Authors" #translate
    #  - id: "tags"
    #    name: "Tags" #translate

    You can also add custom filters of your own. You can insert a custom filter anywhere you like, for example:

    searchFilter:
      - id: "document-types"
        name: "Document Types" #translate
      - id: "document-states"
        name: "Document States" #translate
      - id: "creation-date"
        name: "Creation date" #translate
      - id: "premium-content"
        name: "Premium Content" #translate
        query: "premium_b:true"
      - id: "sections"
        name: "Sections" #translate
      - id: "authors"
        name: "Authors" #translate
    #  - id: "tags"
    #    name: "Tags" #translate
  4. Save the file.

  5. Enter:

    # dpkg-reconfigure cue-web-2.8

    This reconfigures CUE with the changes you have made.

Note the following:

  • A custom filter's query property of must contain a valid Solr query clause. This means that in order to write such a clause you need to know both Solr query syntax and your Solr schema (in order to know what fields are indexed and how to identify the fields correctly).

  • The predefined search filters have fixed IDs. Make sure that your custom filter IDs do not clash with them.