Obtaining the available search keys

The AvailableSearchKeysConfig complex type allows you to retrieve a list of the searchable attributes and search interfaces available in the data domain.

The AvailableSearchKeysConfig type identifies the items that are searchable — search interfaces and searchable properties. This type has the following format:
<AvailableSearchKeysConfig Id="?">
   <StateName>?</StateName>
</AvailableSearchKeysConfig>
where:
  • Id is an optional attribute that provides an arbitrary identifier for this configuration.
  • StateName is an optional attribute that specifies the name of a state in the request. Note that specifying a state has no effect on the results (even in a request with multiple states).

Sample request for available search keys

This example shows how to make a request for available search keys using the AvailableSearchKeysConfig type:
<Request xmlns="http://www.endeca.com/MDEX/conversation/3/0">
   <State/>
   <AvailableSearchKeysConfig Id="MySearchKeys"/>
</Request>

Note that the StateName element is not used because the state is an empty, unnamed state.

Response for available search keys

The response contains an AvailableSearchKeys component that lists all of the searchable keys in a single alphabetically ordered list, as shown in this example:
<cs:Results xmlns:cs="http://www.endeca.com/MDEX/conversation/3/0" 
     xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
   <State xmlns="http://www.endeca.com/MDEX/conversation/3/0" x
       mlns:ns2="http://www.endeca.com/MDEX/eql_parser/types" 
       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/>
   <cs:AvailableSearchKeys> 
      <cs:AvailableSearchKey Interface="true">
         <cs:Key>AllWineSearch</cs:Key>
         <cs:DisplayName>AllWineSearch</cs:DisplayName>
      </cs:AvailableSearchKey>
      <cs:AvailableSearchKey Interface="false">
         <cs:Key>Description</cs:Key>
         <cs:DisplayName>Wine Description</cs:DisplayName>
      </cs:AvailableSearchKey>
      <cs:AvailableSearchKey Interface="false">
         <cs:Key>WineType</cs:Key>
         <cs:DisplayName>Wine Type</cs:DisplayName>
      </cs:AvailableSearchKey>
   </cs:AvailableSearchKeys>
</cs:Results>

Each AvailableSearchKey element lists the name of a searchable attribute or search interface (the Key sub-element), and the display name (which can have a non-NCName format). The Interface attribute distinguishes whether the search key is a searchable attribute or a search interface. If the search key is a search interface, the attribute is set to true. If the search key is not a search interface and is a searchable attribute, the attribute is set to false.

In this sample response, one search interface, AllWineSearch, and two attributes, Description and WineType, are listed as available search keys.