Searching XML Information

XML indexing lets site visitors search XML information collected from Smart Forms and view the results. The results appear as a list of topic titles, optionally followed by the content summary. The Ektron Windows Service manages the background processing that creates XML indexes. See Also: Ektron Windows Service.

There are 2 ways that XML indexing can make XML content available to your site visitors.

You can choose the XML fields to index with the Data Designer. You can also validate those fields to be numbers, dates, Boolean, or string values. After you identify fields to be indexed, a search dialog is created. Where appropriate, the dialog automatically populates drop-down lists from the indexed data.

Important notes

Important Notes:

  • XML indexing is only available for information collected on XML Smart Forms. It cannot find information in other types of content.
  • Ektron content has a Content Searchable check box, which you must check if you want the Index Search to find Smart Form content. See Also: Ensuring Your Content is Searchable
  • Do not insert a calendar field into a Smart Form that allows multiple entries (using the Allow more than One option on the dialog). If you do, you cannot search the Smart Form using that field.
  • For Smart Form fields to searchable, they must be stored as elements not attributes.If you are upgrading to version 7.5 or higher, inspect your Smart Forms and change field properties as needed so they are stored as elements not attributes.
Setting up a search

Setting up a Search

To create a search:

  1. Select a Smart Form.
  2. Assign indexing to each field to be searched. You can index the following types of fields: Checkbox, Plain Text, Choices, List, Calculated, Image Only, Link, Calendar.
    1. Choose Workarea > Settings > Configuration > Smart Form Configuration.
    2. Select a Smart Form configuration that you want to index and open its Data Design.
    3. Move the cursor to the first field you want to index, right click the field, and choose Field Properties. A dialog box appears.
    4. Check Indexed.
    5. Repeat these steps for every field by which you want site visitors to search the Smart Form.

      IMPORTANT: If a Smart Form configuration field's xpath exceeds 64 characters, Microsoft Search Server 2010 cannot search it. So, if you need to index such a field, reduce the length of its xpath to less than 64 characters.
      To see a configuration's XPaths, click the Display Information tab.

       


  3. Set up the search screen.
    • Xpath—The xpath to each indexed field.
    • Label—The index field’s field name, as defined on its dialog.
    • Multiple—Check this box if you want to allow the user performing the search to select more than one value. This checkbox only appears with List and Choice fields.
  4. When you save a Data Design form, a dialog appears that lets you view all and modify indexed fields.
     

    • Xpath—The xpath to each indexed field.
    • Label—The index field’s field name, as defined on its dialog.
    • Multiple—Check this box if you want to allow the user performing the search to select more than one value. This checkbox only appears with List and Choice fields.

    NOTE: To select more than one value on the search screen, the user holds down the <Ctrl> key while selecting additional options.

If you choose NoSelection in a search field, the search disregards that field when compiling results. However, you must select a value (or range of values) in at least one field to get results.

NOTE: The IndexSearch server control has been deprecated. Use the XML Search server controls to display a Smart Form’s search screen on a Web form. For information on the IndexSearch server control, refer to the Ektron Reference version 8.0 or earlier at www.ektron.com/Resources/Product-Documentation/.

Validation

Validation ensures that the user completing an XML form enters the right type of data. You can decide if the user’s input should be a number, boolean, date, string, zip code, and so on. If you do not specify type attributes using validation data, the field is a string.

Validation is especially important when users search XML data, because it helps the search find the correct information. For example, if a field collects a zip code but you set its type to plain text, a user completing the form can insert anything into the field. If the user inserts the letter “o” instead of the number zero (0), the field accepts that input but the search will not find that record. On the other hand, if you set validation to zip code, the user can only insert 5 or 9 digits—any other entry is rejected.

User- versus developer-selected search criteria

User- versus Developer-Selected Search Criteria

There are 2 ways that XML Indexing can make XML content available to your site visitors.

  • Present a screen of search criteria. A site visitor uses the screen to select the desired kind of information. For example, your site sells outdoor clothing, and a user searches for wool hats under $20.00.
  • Determine the search and display criteria programmatically using a custom function. Your Web developer inserts a control that specifies search and display criteria. For example, your site sells books. A site visitor sees a navigation link Find books under $5.00. When the link is clicked, the control searches your XML content and returns all books whose price is less than $5.00.

NOTE: The Ektron Windows Service manages the background processing that creates XML indexes. See Also: Ektron Windows Service.

Ektron content has a Content Searchable check box, which must be checked if you want the Index Search to find Smart Form content. See Also: Ensuring Your Content is Searchable

To set up a developer-defined search, which defines both the criteria and the results page, use the SearchParmXML property of IndexSearch Server Control. For more information, see Searching XML Information.

Types of Search Criteria

Types of Search Criteria

XML Indexing allows multi-dimensional searches on all types of XML data.

  • Plain text—Use an exact phrase, or any word or letter in a phrase
  • Numerical and date information—Use expressions such as greater than, less than, or between 2 values
  • List and choice fields—Display the field values and let the user select relevant ones.

    NOTE: Choices field values can consist of single letter.

  • Image Only—Use the alt or src attribute value
  • Link—Use the text or href attribute value

For every search field, NoSelection is a value. If this is chosen, the search disregards that field when compiling results. However, the user must select a value (or range of values) in at least one field to get results.

WARNING! Do not insert a calendar field into a Smart Form that allows multiple entries (using the Allow more than One option on the dialog). If you do, you cannot search the Smart Form using that field.

For Smart Form fields to searchable, they must be stored as elements not attributes. If you are upgrading to version 7.5 or higher, inspect your Smart Forms and change field properties as needed so they are stored as elements not attributes.

Specifying which XML elements are indexed

Specifying Which XML Elements are Indexed

XML indexing allows multi-dimensional searches on all types of XML data.

  • Plain text—Use an exact phrase, or any word or letter in a phrase
  • Numerical and date information—Use expressions such as greater than, less than, or between 2 values
  • List and choice fields—Display the field values and let the user select relevant ones. Choices field values can consist of single letter.
  • Image Only—Use the alt or src attribute value
  • Link—Use the text or href attribute value

If a Smart Form configuration field's xpath exceeds 64 characters, Microsoft Search Server 2010 cannot search it. So, if you need to index such a field, reduce the length of its xpath to less than 64 characters. To see a configuration's XPaths, click the Display Information tab.

 

Validation

Validation ensures that the user completing an XML form enters the right type of data. You can decide if the user’s input should be a number, boolean, date, string, zip code, and so on. If you do not specify type attributes using validation data, the field is a string.

Validation is especially important when users search XML data, because it helps the search find the correct information. For example, if a field collects a zip code but you set its type to plain text, a user completing the form can insert anything into the field. If the user inserts the letter “o” instead of the number zero (0), the field accepts that input but the search will not find that record. On the other hand, if you set validation to zip code, the user can only insert 5 or 9 digits—any other entry is rejected.