Each request to the Conversation Web Service consists of a filter state and a list of content element configurations and operators to compute. This topic provides examples showing the contents of a typical request.
The following request is used for a record search query. In this example, state and content element configuration are not shown and only the Operator element is shown. Operator is the base type for various types of operators, such as ApplySpellingSuggestionOperator, RefinementOperator, and SearchOperator.
In this example, the Operator is used with SearchOperator type that is used to add a text search component to the filter state. It specifies the search interface that must be used, and also the search terms entered by the user in the front-end application.
<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>
In general, for the SearchFilter type of Operator, you can specify various aspects of your request configuration, such as the name of the configured search interface, the search mode, the relevance ranking strategy, the language of the query (to be used for spelling correction, for example), and whether to enable snippeting.
Similarly, for other types of Operator, you can specify options of their own. For instance, for the RecordKindOperator, you can specify the record type on which the query will operate.
To remove an operator from the filter state, you can use PopName_of_operatorOperator, where Name_of_operator is the name of the operator that you want to remove, such as SearchOperator.
For more information on value search, search modes, and relevance ranking, see the dedicated sections in this guide. For more information on the detailed syntax of various types of operators, see the Oracle Endeca Server API Reference for the Conversation Web Service.
<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>
The following example also contains all three elements of a Conversation Web Service request — state, operator and content element configuration. This example uses the previously computed State to first request a list of available refinements on filtered records, and then to compute and list the individual records under these refinements.
<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>
For more information on requesting breadcrumbs, see Using Breadcrumbs.
In this example, the state and operators are the same as in the previous example, but ContentElementConfig is of type LQLConfig, which is the type that should be used to issue queries using EQL statements. The contents of the EQL statement is included in the LQLQueryString.
For additional examples and details on EQL, see the Oracle Endeca Server EQL Guide.
<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>