Class Name |
|
---|---|
Component |
|
This droplet takes as input several search query attributes, constructs a TypeAheadRequest
based on these inputs, and submits the query to ATG Search. The droplet then receives the results as a list of autocomplete strings matching the query text and renders them on the page.
Input Parameters
context
The session-scoped component of class atg.search.formhandlers.SearchContext
that maintains information about the connection to ATG Search. Typically this is set to /atg/search/formhandlers/SearchContext
.
text
The search query text to return autocomplete strings for.
environment
The name of the ATG Search environment (created through Search Administration) whose index contains the type-ahead data.
language
The language of the type-ahead data. This should match the query language.
sort
The type of sorting to perform on the list of matching autocomplete strings. Options are:
“
alpha
” -- Sort in alphabetical order.“
length
” -- Sort by the length of the strings.“
value
” (default) -- Sort by the rankings provided with the type-ahead data.“
match
” -- Sort using the search engine’s metric that takes into account both the rankings provided with the type-ahead data and the lengths of the matching strings (with shorter strings ranked higher because the search substring represents a greater proportion of the matching string).
sortOrder
The ordering to apply to the sorted results. Can be either “ascending
” or “descending
” (default).
Output Parameters
match
This parameter is set iteratively to each matching autocomplete string.
Open Parameters
itemformat
This open parameter is rendered once for each matching autocomplete string.
Examples
For an example of using the TypeAheadDroplet
, see Implementing Type-Ahead.