Search forms with a preset search statement

As you may know, Adlib offers three ways to put together a search query: via the Search wizard, via a Search form (aka Query by form) in the Start menu or via the Advanced search. In a Search form you’ll enter search keys in one or more fields, with which Adlib will create a (combined) search statement in the background.

From Adlib 7.3 – you don’t need the 7.3 version of Designer – Adlib is able to add a hidden, partial search statement (which you have set up on the search form earlier) to the search statement which has been put together implicitly by the user via the relevant search form. This has the advantage that search forms can be created for a specific use. In the Query by form Archives in the Archive (catalogue) data source for example, you could set up a partial search statement to make sure that the search form is always used to search on the item description level. In the Query by form Object in the Internal object catalogue on the other hand, you could specify the condition that the form will only search for objects on a certain location or after a certain historical acquisition date, for example.

The partial search statement must be set in the properties of a search form which you have opened in the Designer Screen editor, on the List fields tab. At the top of the Tag list, enter the AddToQuery parameter. Next to it, as the English Text value, enter the desired partial search statement: that search statement is of the Advanced search type but should always start with a Boolean operator (AND or AND NOT, the other operators aren’t very useful) because in the end Adlib must be able to create a combined search statement of it.

Example:

1.In an XPlus model application 4.2 there’s a Query by form Collection available in the Internal object catalogue data source. Let’s add a fixed search statement to that search form.
2.In the Designer Application browser, open your application structure and beneath it the Internal object catalogue. Then open the Methods list > Query by form Collection > Screens and double-click Query by form Objects to open the screen in the Screen editor.
3.Right-click an empty spot in the opened search form and choose Properties in the pop-up menu which opens. Then on the List fields tab, underneath Tag, fill in the AddToQuery parameter and type your search statement behind English in the list on the right. Of fields, provide the tag or the English field name. Enter for example: and current_location = Amsterdam.
 
PresetSearchForm2
4.Close the properties window, save the changes to the screen, restart Adlib en observe the consequences when you perform a search in Adlib, using the relevant search form. Suppose you’re searching for Object name: painting, then Adlib will really search on: object_name = painting and current_location = Amsterdam.
 
PresetSearchForm3

If the user doesn’t enter any values, the search will proceed with the fixed search statement only. In this example that would be: (and) current_location = Amsterdam.