Defining Which Fields To Search for Basic Finds
By default, Aptify's Basic Find dialog searches for a record within a service based on the record's name (the first Is Name field in the entity's field sequence) or ID. Alternatively, Aptify allows an administrator to configure a different field or full text search to be used as the basic search items.
To support this functionality, Aptify includes the FindBasicSearchItemsToSearch attribute (which can be added to the Configuration > Attributes tab of any entity) to control which items (fields or full text indexes) are searched when using the Basic Find dialog. The value for this new attribute is an XML fragment and must be entered using the following syntax:
<ItemsToSearch> <Item Name="Name1" FilterType= "FilterType1" Operator= "Operator1"/> <Item Name="Name2" FilterType= "FilterType2" Operator= "Operator2"/> </ItemsToSearch>
Within the ItemsToSearch element, any number of elements can be defined. The Item Name element has three defined attributes:
- Name: The name of the field or the display name of the Full Text Index Filter, depending on the value of FilterType. The value for this attribute must match a field or full text index filter in the entity. This is a required attribute.
- FilterType: The type of filter. This is a required attribute. The following options are available:
- Field: The value in the Name attribute must match the name of an entity Field within the entity.
- FullTextIndex: The value in the Name attribute must match the display name of a Full Text Index Filter defined on the entity.
- Operator: Defines the operator to use in the search. The value of this attribute must match the English language (default) text for an Operator that is supported for the field or full text filter that is being searched. For numeric fields, the numeric operators (like =, < and >) can also be used. This is a required attribute. The available operators are dependent upon the value of the FilterType (field or full text index) and the type of field (text, numeric and bit).
The following operators are available for text fields and full text indexes. Note that not all operators are available for both text fields and full text indexes (see each operator below for details).
- Exactly Matches: Field value exactly matches the characters entered in the Find Basic dialog. This operator is available for text fields only.
- Contains: Field value contains the characters entered in the Find Basic dialog. The characters can appear anywhere in the field. This operator is available for both text fields and full text indexes.
- Contains (Full Text): This is the same as Contains operator, however, this operator is available for full text indexes only.
- Begins With: Field value begins with the characters entered in the Find Basic dialog. This operator available for text fields only.
- Ends With: Field value ends with these characters entered in the Value column. This operator available for text fields only.
- FreeText: The value of a record's field must contain something similar to the character or phrases entered in the Basic Find dialog. This operator is available for the full text filter type.
The following operators are available for numeric fields only:
- = or Equals: The value of a record's specified field must equal the value entered in the Find Basic dialog.
- > or Greater Than: The value of a record's specified field must be greater than the value entered in the Find Basic dialog.
- >= or Great Than Or Equals: The value of a record's specified field must be greater than or equal to the the value entered in the Find Basic dialog.
- < or Less Than: The value of a record's specified field must be less than the value entered in the Find Basic dialog.
- <= or Less Than Or Equals: The value of a record's specified field must be less than or equal to the value entered in the Find Basic dialog.
- <> or Does Not Equal: The value of a record's specified field must not equal the value entered in the Find Basic dialog.
- != or Does Not Equal: The value of a record's specified field must not equal the value entered in the Find Basic dialog.
The following fields are available for bit fields only:
- Is True: Bit is set to 1.
- Is False: Bit is set to 0.
Example
For the Persons service, you could define the following two search items to search on when the Basic find dialog is launched from the Persons service. The first item searches the Country field of the Persons records and returns those that begin with the value entered in Basic Find dialog. The second item searches the full text index that is defined on the Persons entity to search address lines. If an address line contains the value entered in the Basic Find dialog, it will be returned.
<ItemsToSearch> <Item Name="Name" FilterType="Field" Operator="Begins With"/> <Item Name="Status" FilterType="FullTextIndex" Operator="Contains" Value="Approved"/> </ItemsToSearch>
Copyright © 2014-2017 Aptify - Confidential and Proprietary