使用可能な検索キーの取得

AvailableSearchKeys複合タイプによって、データ・ドメイン内で使用できる検索可能属性および検索インタフェースのリストを取得できます。

AvailableSearchKeys要素には、1つ以上のAvailableSearchKey要素が含まれます。複合タイプAvailableSearchKeyは、検索可能な、つまり検索インタフェースおよび検索可能プロパティである項目を識別します。このタイプの書式は、次のとおりです。
<complexType name="AvailableSearchKey">
  <annotation>
    <documentation>
   		A key used to identify searchable properties and search interfaces. 
    </documentation>
  </annotation>
  <sequence>
    <element name="Key" type="string"/>
    <element name="DisplayName" type="string" />
  </sequence>
  <attribute name="Interface" type="boolean" use="required" />
</complexType>

Interface属性は、検索キーが検索可能属性と検索インタフェースのどちらであるかを識別します。検索キーが検索インタフェースである場合、属性はtrueに設定されます。検索キーが検索インタフェースではなく、検索可能属性である場合、属性はfalseに設定されます。

使用可能な検索キーのリクエスト

使用可能な検索キーのリクエストを行うには、次の例に示すように、AvailableSearchKeysConfigコンポーネントを使用します。
<Request xmlns="http://www.endeca.com/MDEX/conversation/2/0">
   <State/>
   <ContentElementConfig xsi:type="AvailableSearchKeysConfig" 
      HandlerFunction="AvailableSearchKeysHandler" 
      HandlerNamespace="http://www.endeca.com/MDEX/conversation/2/0" 
      Id="MySearchKeys" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</Request>

Id属性は、構成の識別子です。

使用可能な検索キーのレスポンス

レスポンスには、次の例に示すように、単一のアルファベット順のリストにすべての検索可能キーがリストされているAvailableSearchKeysコンポーネントが含まれています。
<cs:Results xmlns:cs="http://www.endeca.com/MDEX/conversation/2/0" 
     xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
   <cs:Request>
      <State xmlns="http://www.endeca.com/MDEX/conversation/2/0" 
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/>
      <ContentElementConfig xsi:type="AvailableSearchKeysConfig" 
        HandlerFunction="AvailableSearchKeysHandler" 
        HandlerNamespace="http://www.endeca.com/MDEX/conversation/2/0" 
        Id="MySearchKeys" xmlns="http://www.endeca.com/MDEX/conversation/2/0" 
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
   </cs:Request>
   <cs:ContentElement xsi:type="cs:AvailableSearchKeys" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <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:ContentElement>
</cs:Results>

AvailableSearchKey要素は、検索可能属性または検索インタフェース(Keyサブ要素)の名前、およびNCName以外の書式を持つことができる表示名をリストします。検索キーが検索インタフェースである場合、Interface属性はtrueに設定されます。

このサンプル・レスポンスでは、1つの検索インタフェースAllWineSearch、および2つの属性DescriptionWineTypeが、使用可能な検索キーとしてリストされます。