Official Content

This is a very simple example.

Suppose that in a university application you want to give the end user the possibility of searching for students using different wildcards in the search query.


In this example, the "Students" Transaction object is aBusiness Component, and its searchable property is set to TRUE. We have a "Search" web panel which displays a grid ("Students") that loads all the results returned by the search. Define the following variables in the "Search" Web Panel object:

  • &SearchResult of SearchResult DataType
  • &SearchResultItem of SearchResultItem DataType

So the load event for the "Students" Grid control will be the following:

Event Students.Load
    &SearchResult = TextSearch.Find(&filter)
    For &SearchResultItem in &SearchResult.Items()
        &title = &SearchResultItem.Title
        &title.Link = &SearchResultItem.Viewer

By selecting one of the items in the list of results returned by the search engine, you are linked to the object specified in the "Search Viewer" property of the Student Transaction.


If no value is specified in this property, the default values for the "Viewer" property of SearchResultItem data type are in this order:

  1. The View of the Work With Pattern associated to this Transaction (if it has Work With Patterns applied).
  2. The  Transaction called in Display mode.

The Title property of SearchResultItem data type is the description attribute of the Transaction (the name of the student in this case).


See also

Full-Text Search in Applications
Full Text Search Examples - Indexing
Full Text Search Data Types

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant