Instantiating a SearchQuery Object

With the PeopleSoft Search Framework, a SearchQuery object is instantiated by instantiating a SearchFactory object, which is used to create a SearchQueryService object. The SearchQuery object is then instantiated from the SearchQueryService.

The high-level program flow is as follows:

import PT_SEARCH:SearchFactory;
import PT_SEARCH:SearchQueryService;
import PT_SEARCH:SearchQuery;

Local PT_SEARCH:SearchFactory &factory = create PT_SEARCH:SearchFactory();
Local PT_SEARCH:SearchQueryService &svc = &factory.CreateQueryService("default");
Local PT_SEARCH:SearchQuery &srchQuery = &svc.CreateQuery();

The PeopleSoft Search Framework classes are application classes, not built-in classes, like Rowset, Field, Record, and so on. Before you can use these classes in your PeopleCode program, you must import them into your program.

An import statement either names a particular application class or imports all the classes in a package.

Using the asterisks after the package name makes all the application classes directly contained in the named package available. Application classes contained in subpackages of the named package are not made available.