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.

sesrch1

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
        Students.Load()
    Endfor
EndEvent

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.

imagesearch7sample

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).

imagesample8search

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