The State type contains inputs that determine the set of records to operate on.
Every request must contain at least one state, each one defining a navigation state for associated ContentElementConfigs.
<State> <Name>?</Name> <CollectionName>?</CollectionName> <SelectedRefinementFilter Name="?" Spec="?" Id="?"> <Source FilterId="?"> <StateName>?</StateName> </Source> </SelectedRefinementFilter> <TextSearchFilter Key="?" RelevanceRankingStrategy="?" Mode="?" EnableSnippeting="?" SnippetLength="?" Language="?">?</TextSearchFilter> <RecordKind>?</RecordKind> <DataSourceFilter Id="?"> <filterAST> <typ:filter/> </filterAST> <filterString>?</filterString> <Source FilterId="?"> <StateName>?</StateName> </Source> </DataSourceFilter> <SelectionFilter Id="?"> <filterAST> <typ:filter/> </filterAST> <filterString>?</filterString> <Source FilterId="?"> <StateName>?</StateName> </Source> </SelectionFilter> </State>
Element | Min/Max Occurrences | Description |
---|---|---|
Name | min=0 max=1 | The name of a
State.
|
CollectionName | min=0 max=1 | The name of an existing collection to operate on. Note that collection names are case sensitive. |
SelectedRefinementFilter | min=0 max=unbounded | Creates a refinement navigation query from a specific refinement. For details, see SelectedRefinementFilter. |
TextSearchFilter | min=0 max=unbounded | Performs a keyword search against specific attribute values assigned to records. For details on its format, see Record search filter. |
DataSourceFilter | min=0 max=unbounded | Uses EQL syntax to filter the corpus of records before any other processing is done. For details, see EQL Record Filters. |
SelectionFilter | min=0 max=unbounded | Uses EQL syntax to provide selection criteria for the final record result set. Typically used in conjunction with DataSourceFilter. For details, see EQL Record Filters. |
In addition, if a request has multiple states, then each config must reference one (and only one) state. If the request has only one named state, then it is optional as to whether the config references that state (as the state will be used in any event in the config).
<Request xmlns="http://www.endeca.com/MDEX/conversation/3/0"> <State> <Name>FlavorSearch</Name> <TextSearchFilter Key="Flavors" Mode="AllPartial" Language="en">oak</TextSearchFilter> </State> <State> <Name>WineSearch</Name> <TextSearchFilter Key="Wine" Mode="AllPartial" Language="en">merlot</TextSearchFilter> </State> <RecordCountConfig Id="FlavorRecs"> <StateName>FlavorSearch</StateName>StateName> </RecordCountConfig> <RecordCountConfig Id="WineRecs"> <StateName>WineSearch</StateName>StateName> </RecordCountConfig> </Request>
<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" xmlns:ns2="http://www.endeca.com/MDEX/eql_parser/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <Name>FlavorSearch</Name> <TextSearchFilter Key="Flavors" Mode="AllPartial" Language="en">oak</TextSearchFilter> </State> <State xmlns="http://www.endeca.com/MDEX/conversation/3/0" xmlns:ns2="http://www.endeca.com/MDEX/eql_parser/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <Name>WineSearch</Name> <TextSearchFilter Key="Wine" Mode="AllPartial" Language="en">merlot</TextSearchFilter> </State> <cs:RecordCount Id="FlavorRecs"> <cs:NumRecords>6381</cs:NumRecords> </cs:RecordCount> <cs:RecordCount Id="WineRecs"> <cs:NumRecords>3073</cs:NumRecords> </cs:RecordCount> </cs:Results>
As the results show, the record search from the FlavorSearch state returns 6381 records, while the record search from the WineSearch state returns 3073 records.