Breadcrumbs information returned by the Conversation Web Service can reflect spelling correction. The following example illustrates this case.
To request breadcrumbs in a search query that returns spelling correction, specify the search keyword in the request, and these two types — BreadcrumbConfig and SearchAdjustmentsConfig. These types are subtypes of the ContentElementConfig.
The request in this example specifies a navigation state that includes a search for a user-entered word fife. It illustrates a search request with a breadcrumb that needs to be corrected for spelling:
<Request xmlns="http://www.endeca.com/MDEX/conversation/1/0"> <State/> <Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SearchOperator" Within="false"> <SearchFilter Mode="All" Key="English"> fife </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/1/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/1/0" Id="SearchAdjustments"/> <PassThrough>...</PassThrough> </Request>
The response from the Conversation Web Service contains the original request with search filter operators applied, the original (not yet spelling-corrected) term fife, and the PopSearchOperator needed for removing the refinement (if the user decides to remove this breadcrumb). Finally, the response also includes the automatically corrected term five in the ContentElement for AppliedAdjustment.
<cs:Results xmlns:cs="http://www.endeca.com/MDEX/conversation/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <cs:Request> <cs:State> <SearchFilter xmlns="http://www.endeca.com/MDEX/conversation/1/0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Mode="All" Key="English"> fife </SearchFilter> </cs:State> <ContentElementConfig xmlns="http://www.endeca.com/MDEX/conversation/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BreadcrumbConfig" ReturnFullPath="true" HandlerFunction="BreadcrumbHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/1/0" Id="Breadcrumbs"/> <ContentElementConfig xmlns="http://www.endeca.com/MDEX/conversation/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SearchAdjustmentConfig" HandlerFunction="SearchAdjustmentHandler" HandlerNamespace="http://www.endeca.com/MDEX/conversation/1/0" Id="SearchAdjustments"/> </cs:Request>
<cs:ContentElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cs:Breadcrumbs" Id="Breadcrumbs"> <cs:SearchBreadcrumb DisplayName="English"> <cs:SearchFilter Key="English" Mode="All"> fife </cs:SearchFilter> <cs:Operator xsi:type="cs:PopSearchOperator"> <cs:SearchFilter Key="English" Mode="All"> fife </cs:SearchFilter> </cs:Operator> </cs:SearchBreadcrumb> </cs:ContentElement> <cs:ContentElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cs:SearchAdjustments" Id="SearchAdjustments"> <cs:AppliedAdjustment> <cs:SearchFilter Key="English" Mode="All"> fife </cs:SearchFilter> <cs:AdjustedTerms> five </cs:AdjustedTerms> </cs:AppliedAdjustment> </cs:ContentElement> </cs:Results>