wiki:Public/Docs/CinnamonUsingAdvancedSearch

Advanced search

General notes

In addition to quick search, Cinnamon allows you to build complex searches accessing all configured index fields and using AND and OR operators. Also, advanced search allows you to use negations, searches for fields having any value and combinations of the two.

Using advanced search

Creating a saved search object

Searches are typically collected in the folder Saved searches which is an ordinary folder. Therefore, you can create subfolders to organize your search objects, assign permissions to subfolders and objects to restrict other users from using or even seeing your searches or link your searches elsewhere. You can place search objects anywhere else in the folder structure, but we recommend to collect your searches in the Saved searches folder. If you need to find the search in another location, we recommend using links.

First, create a new search object in the Saved searches folder:

  • Right-click the Saved searches folder and select New object without content.

Creating a new search object.

  • In the New object dialog, set the values as follows:
    • Specify a name according to your requirements.
    • Choose the object type Search.
    • Leaving the language value on the default value (Multi-language) does not affect the function of the search object, but you might want to choose (No language) instead which describes the language of the object more correctly.

Setting the correct parameters for a new search object.

Editing the search object

General functions of the search editor tab

  • Click on the newly created object in the Contents tab in the upper right corner of the CDCplus window.
  • Select the Search tab in the lower right corner of the window. You will see the search editor tab with an empty search.
  • Choose whether you want to search objects or folders. In the upper left corner of the search editor tab, there are two radio buttons. The left button sets the search object for objects, and the right button for folders.

Searching objects or folders.

  • Select the desired version behaviour of the search, using the three radio buttons to the right ob the object / folder selector. The. control is only relevant for objects, since folders have no versions. Please note that only those versions are returned that actually fulfill the search definition. There might be more versions that are not returned, because they do not fulfill the search criteria.
    • The left button sets the search to return the newest version in the main branch.
    • The mid button sets the search to return the end versions of all branches.
    • The right button sets the search to return all versions.

Selecting the version behaviour of search.

  • By right-clicking into the search definition space (the white box on the left side of the tab), you can create the nodes making up your search definition.
  • You can test a search even though it is not defined yet by clicking on the binocular button on the bottom of the tab. Whenever you execute a search, the results are shown in a new window. Even when there are no results, a new window opens with an empty result list.
  • Search in Cinnamon is based on the Open Source Lucene index engine. The search editor tab translates the search you define to a Lucene query. You can see the raw Lucene query when you click the binocular / window button next to the search button.
  • When you are done defining your search, you can save the search using the disk button in the lower left corner of the tab.

A simple example: searching for objects with a certain name

  • Right-click into the search definition space and select Add term. A green flag with Name equals next to it appears in the space.
  • Click on the line you just created. In the right portion of the editor, some controls will appear. The field name is already preset with the default field, Name.
  • Into the red text box, type your search string. The background color turns from red to white. A red background indicates an invalid (in this case: empty) search string. For other fields, administrators can also define more complex rules for valid search string syntax, using Regular Expressions.
  • In the combo box above the search string field, choose the desired comparison operator:
    • equals matches fields that are exactly the string you specified.
    • starts with matches fields that begin with the string you specified, but may have further trailing characters.
    • contains matches fields that contain the string you specified, but may have leading and / or trailing characters.

    NOTE: The following rules apply:

    • Search is case-insensitive, it does not matter whether you use upper- oder lower-case characters, you will always get the same result.
    • Using contains significantly reduced search performance, due to the way the index works.
    • Multi-value fields like content match when any of the field's tokens (words) match.

Our sample search now looks like this:

Sample search for objects whose name starts with "unused".

An advanced example: DITA topics that are not used anywhere.

Cinnamon can search for many parameters, and administrators can remove or edit existing ones and add new, custom parameters, or index fields. Here are some examples for fields:

  • Content allows to search the content of an object. This works with most file types that have textual content, like XML, Microsoft Word, Excel, PowerPoint, Open Office and many others.
  • Format: the file format of the content.
  • Object type: the type the user has assigned to the object.
  • Path: the folder path of the object.
  • Locked by: the lock status of the object, and by whom it was locked.
  • Various relation information, for example, parents or children of a certain type the object has.

You can combine multiple fields using Boolean operators (AND, OR). Such operators can also be nested within operators as deeply as you require.

The following search finds DITA topics that are not referenced by any parent manual:

Search definition to find DITA topics not used anywhere.

This search exposes some of the advanced capabilities of search editor:

  • Multiple search terms are combined in a Boolean operator.
  • Negation of a search (the objects must NOT have the defined field content).
  • ANY flag (the search matches, if the field exists on the object, with any value).

In this case, we defined a search that does the following:

  • It searches for objects that are the latest versions of their version tree. Branches and older versions are ignored.
  • Both of the following criteria must be fulfilled because of the AND operator:
    • The object must have the object type DITA topic.
    • The object must NOT have ANY value of parent.relations.child_content. This means, that there may be no objects that refer to the content of the objects returned by the search.

By combining the structures and functions described in this article, you can create searches of significant complexity.

NOTE: A very complex search is not slower than a very simple search. The index performance scales with the number of results, not with the number of terms it evaluates. One exception is that you should avoid the contains comparison operator if possible. Compared with other operators like equals or starts with it is significantly slower due to the index concept.

Last modified 4 years ago Last modified on Mar 24, 2020, 6:20:16 PM

Attachments (6)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.