SearchQuery Class Properties

In this section, the SearchQuery class properties are presented in alphabetical order.

Description

Use this property to set or return the list of search categories (search indexes) you want to search as an array of SearchCategory objects. If this property is defined, the Execute method will run the query on all the search categories specified in this property.

Important! If this property is undefined, the query will be executed against all search categories in the search engine instance.

This property is read-write.

Example

The following example uses two search categories called cat1 and cat2.

import PT_SEARCH:SearchCategory;

Local array of PT_SEARCH:SearchCategory &cats;

&cats = CreateArray(create PT_SEARCH:SearchCategory("cat1"));
&cats.Push(create PT_SEARCH:SearchCategory("cat2"));

&searchQuery.Categories = &cats;

Description

Use this property to set a search string that contains one or more words. The search results include those documents that contain any of these words and whatever is defined by other search text properties (for example, ContainsExactPhrase, QueryText, or WithoutWords).

This property is not required.

This property is read-write.

Description

Use this property to set a search string that contains one or more words. The search results include those documents that this exact phrase and whatever is defined by other search text properties (for example, ContainsAnyWords, QueryText, or WithoutWords).

This property is not required.

This property is read-write.

Description

This property is reserved for future use.

Description

Use this property to set or return the size of the result set as an integer. After invoking the Execute method, use this property to return the value of the size parameter passed to Execute. Alternatively, if the search query is to be executed by the ExecuteQuery method of the QueryService class, then use this property to specify the size of the result set.

Example

For example, one could compare DocsRequested to the GetDocumentCount method of the ResultCollection class to determine if there are possibly more documents to be retrieved.

The StartIndex and DocsRequested properties (that is, the start and size parameters to the Execute method) allow for “chunking” of search results. The idea is to repeatedly call Execute while increasing the start parameter by the increment specified by size. For example, the following psuedo-code will return the first 100 results the first time through the loop. The second time through the loop, it will return documents 101 through 200, and so on.

int start=1, size=100


,.// return results in chunks of 100 documents
while not done
   results = query.execute(start, size)
   if (results.GetDocumentCount() < query.DocsRequested)
      done = true
      // we got fewer documents than we asked for so we're done executing this       // query
   if (results.GetDocumentCount() = 0)
      done = true
      // no more documents being returned so we're done executing this query

   // do something with the results

   start = start + size
end-while

Description

Use this property to set or return a Boolean value indicating whether to enable the set of extended filter operators (specifically, the notequals operator). In addition, when this property is set to True, all search filters are added to the QuerytText property and sent to the search engine in this manner. Otherwise, when this property is set to False, the search filters are handled by the Filters property as an array of SearchFilter objects. The default value is False.

This property is not required.

This property is read-write.

Description

Use this property to set or return an array of FacetFilter objects on which the search results are currently filtered.

Note: The SearchCategory class GetFacetFilters method can be used to get the initial list of facet filters.

This property is not required.

This property is read-write.

Description

Use this property to set or return a search filter connector as a string. A search filter connector is used to join search filters. The acceptable values are: AND and OR. The default value is AND.

This property is not required.

This property is read-write.

Description

Use this property to set or return the list of search filters as an array of SearchFilter objects.

This property is not required.

This property is read-write.

Description

This property is reserved for future use.

Description

Use this property to set or return a Boolean value indicating whether to return images in the search results.

This property is read-write.

Example

Local PT_SEARCH:SearchQuery &qry;

...

If PTSF_QRY_CLIENT.PTSF_SHOW_IMAGE = "Y" Then
   &qry.IncludeImages = True;
End-If;

Description

Use this property to set or return a three-character string representing the language code to which the search query results should be restricted. This property must be a PeopleSoft language code—for example, ENG for English, FRA for French, and so on.

Note: If no value is specified, the query will be executed against all languages.

This property is read-write.

Example

&SearchQuery.Language = "ENG";

Description

Use this property to set or return a Boolean value indicating whether duplicates in the result set should be marked as such. A search result can be identified by running the isDuplicate method.

This property is not required. However, it defaults to False if no value is specified.

This property is read-write.

Description

Use this property to set or return an Integer value representing the maximum number of child facet nodes. For example, if there are 100 facet values, setting this property to 10 will return the first ten facet values as determined by the sorting order. If this property is not set, the default value is -1, which indicates to return all child nodes.

This property is not required.

This property is read-write.

Description

Use this property to set or return an Integer value representing the minimum number of documents required for the child facet node to be returned. Child facet nodes with less than this document count are not returned. If this property is not set, the default value is 1, which indicates that a facet node must have at least one document to be returned.

This property is not required.

This property is read-write.

Description

Use this property to set or return the programmatically generated search string as a string. This search string is not displayed to the end user.

This property is not required.

This property is read-write.

Description

Use this property to set or return a string representing the text to use in the search query. The search results include those documents that contain this text and whatever is defined by other search text properties (for example, ContainsAnyWords, ContainsExactPhrase, or WithoutWords).

Note: If no value is specified and none of the other search text properties are defined, then all documents in the index are returned.

This property is read-write.

Description

Use this property to set or return a Boolean value indicating whether duplicates should be removed from the result set.

This property is not required. However, it defaults to False if no value is specified.

This property is read-write.

Description

Use this property to set or return the list of custom attributes to be included for each search result. The list is an array of SearchField objects.

This property is not required.

This property is read-write.

Description

Use this property to set or return a Boolean value indicating whether to compute and return document counts per facet node.

This property is not required. However, it defaults to True if no value is specified.

This property is read-write.

Description

Use this property to set or return a string of search terms as a string. This is used to search within the current results.

This property is not required.

This property is read-write.

Description

Use this property to set or return a String value indicating the sort order by which facet nodes are sorted:

Value

Description

ALPHA_ASC

Sort by node name alphabetically ascending.

ALPHA_DES

Sort by node name alphabetically descending.

COUNT_ASC

Sort by document count numerically ascending.

COUNT_DES

Sort by document count numerically descending.

COUNT_DES is the default value, which means that facet nodes with highest document count are displayed first in the list.

This property is not required.

This property is read-write.

Description

This property is reserved for future use.

Description

Use this property to set or return an integer representing the first document of the result set. After invoking the Execute method, use this property to return the value of the start parameter passed to Execute. Alternatively, if the search query is to be executed by the ExecuteQuery method of the QueryService class, then use this property to specify the first document of the result set.

Description

This is reserved for future use.

Description

Use this property to set a search string that contains one or more words. The search results include those documents that do not include any of these words and whatever is defined by other search text properties (for example, ContainsAnyWords, ContainsExactPhrase, or QueryText).

This property is not required.

This property is read-write.