= Advanced search == General notes In addition to [wiki:Public/Docs/CinnamonUsingQuickSearch 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//. [[Image(wiki:Public/Docs/CinnamonUsingAdvancedSearch:NewSearch1.png)]] * 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. [[Image(wiki:Public/Docs/CinnamonUsingAdvancedSearch:NewSearch2.png)]] == 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. [[Image(wiki:Public/Docs/CinnamonUsingAdvancedSearch:SearchObjectFolder.png)]] * 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. [[Image(wiki:Public/Docs/CinnamonUsingAdvancedSearch:SearchVersions.png)]] * 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 [http://lucenenet.apache.org/index.html 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 [https://en.wikipedia.org/wiki/Regular_expression 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: [[Image(wiki:Public/Docs/CinnamonUsingAdvancedSearch:SearchName.png)]]