対話Webサービスへの各リクエストは、フィルタ状態と、コンテンツ要素構成および計算する演算子のリストから構成されます。ここでは、標準的なリクエストのコンテンツを示す例を示します。
次のリクエストは、レコード検索問合せに使用されます。この例では、状態およびコンテンツ要素構成は示されず、Operator要素のみ示されています。Operatorは、ApplySpellingSuggestionOperator、RefinementOperatorおよびSearchOperatorなどの各種演算子のベース・タイプです。
この例では、Operatorは、フィルタ状態にテキスト検索コンポーネントを追加するために使用されるSearchOperatorタイプと一緒に使用されます。使用する必要がある検索インタフェースと、ユーザーがフロントエンド・アプリケーションで入力した検索語も指定します。
<Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SearchOperator" Within="false"> <SearchFilter Mode="AllPartial" RelevanceRankingStrategy="numfields" Key="PROD_CATEGORY" EnableSnippeting="false" Language="en"> electronics </SearchFilter> </Operator>
一般に、SearchFilterタイプのOperatorには、構成された検索インタフェースの名前、検索モード、関連性ランキング方針、問合せの言語(スペル修正に使用する場合など)、スニペットを有効にするかどうかなど、リクエスト構成の様々な側面を指定できます。
同様に、他のタイプのOperatorでは、オプションを自分で指定できます。たとえば、RecordKindOperatorの場合、問合せが機能するレコード・タイプを指定できます。
フィルタ状態から演算子を削除するには、PopName_of_operatorOperatorを使用できます(Name_of_operatorは、SearchOperatorなど、削除する演算子の名前です)。
値検索、検索モードおよび関連性ランキングの詳細は、このガイドの該当する項を参照してください。様々な演算子タイプの詳細な構文については、対話WebサービスのOracle Endeca Server APIリファレンスを参照してください。
<Request xmlns:ns2="http://www.endeca.com/MDEX/lql_parser/types" xmlns="http://www.endeca.com/MDEX/conversation/2/0"> <State> <SelectedRefinementFilter Name="DimDate_MonthName" Spec="May"/> <SearchFilter Key="All">mountain</SearchFilter> </State> <Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RecordKindOperator"> <RecordKind>data</RecordKind> </Operator> <ContentElementConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RecordListConfig" Id="RecordList" HandlerNamespace="http://www.endeca.com/MDEX/conversation/handlers/2010" HandlerFunction="RecordListHandler"> <RecordsPerPage>2</RecordsPerPage> <Page>0</Page> </ContentElementConfig> </Request>
次の例にも、対話Webサービス・リクエストの3つの要素すべて(状態、演算子およびコンテンツ要素構成)が含まれます。この例は、以前に計算されたStateを使用して、フィルタ処理されたレコードの絞込みのリストをまずリクエストし、次にそれらの絞込みにおいて個々のレコードを計算してリストを表示します。
<Request xmlns:ns2="http://www.endeca.com/MDEX/lql_parser/types" xmlns="http://www.endeca.com/MDEX/conversation/2/0"> <State> <SelectedRefinementFilter Name="DimDate_MonthName" Spec="May"/> <SearchFilter Key="All">mountain</SearchFilter> </State> <Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RecordKindOperator"> <RecordKind>data</RecordKind> </Operator> <ContentElementConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NavigationMenuConfig" Id="NavMenu" HandlerNamespace="http://www.endeca.com/MDEX/conversation/handlers/2010" HandlerFunction="NavigationMenuHandler"> <RefinementGroupConfig Name="Product" Expose="true"> <RefinementConfig Name="ProductCategoryName" Expose="true" MaximumCount="10"/> <RefinementConfig Name="ProductName" Expose="true" MaximumCount="10"/> </RefinementGroupConfig> </ContentElementConfig> </Request>
<Request xmlns="http://www.endeca.com/MDEX/conversation/2/0"> <State/> <Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SearchOperator" Within="false"> <SearchFilter Mode="All" Key="PROD_NAME" Language="fr"> envoy </SearchFilter> </Operator> <ContentElementConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BreadcrumbConfig" ReturnFullPath="true" HandlerFunction="BreadcrumbHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/2/0" Id="Breadcrumbs"/> <ContentElementConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SearchAdjustmentConfig" HandlerFunction="SearchAdjustmentHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/2/0" Id="SearchAdjustments"/> <PassThrough/> </Request>
ブレッドクラムのリクエストの詳細は、「ブレッドクラムの使用」を参照してください。
この例では、状態と演算子は前の例と同じですが、ContentElementConfigのタイプはLQLConfig (EQL文を使用した問合せの発行に使用する必要があるタイプ)です。EQL文の内容はLQLQueryStringに含まれます。
EQLのその他の例や詳細は、Oracle Endeca Server EQLガイドを参照してください。
<Request xmlns:ns2="http://www.endeca.com/MDEX/lql_parser/types" xmlns="http://www.endeca.com/MDEX/conversation/1/0"> <State> <SelectedRefinementFilter Name="DimDate_MonthName" Spec="May"/> <SearchFilter Key="All">mountain</SearchFilter> </State> <Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RecordKindOperator"> <RecordKind>data</RecordKind> </Operator> <ContentElementConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LQLConfig" Id="EQL" HandlerNamespace="http://www.endeca.com/MDEX/conversation/handlers/2010" HandlerFunction="LQLHandler"> <LQLQueryString> RETURN "results" AS SELECT COUNT(1) AS numtransactions, SUM("FactSales_SalesAmount") AS totalsales GROUP BY "DimGeography_StateProvinceName" </LQLQueryString> </ContentElementConfig> </Request>