Record search (also called text search) search records that contains a particular keyword.
The resulting results are records :
In addition to basic record search, other features affect the behaviour of record search, such as:
Record search queries in a Studio application are made from the Search Box component and the entire Studio application is re-summarized based on matching search results.
Because record search returns a navigation page, it is important to remember that the record search parameter acts as a record filter in the same way that an attribute value does, even though it is not a specific value.
Rec ID | Managed attribute BikeType: | Standard attribute “Name”: | Standard attribute “Description”: |
---|---|---|---|
1 | Road Bikes | Road-450 | can do double-duty for racing or long-range mileage… |
2 | Road Bikes | Road-550-W | its speed comes at the sake of comfort… |
3 | Touring Bikes | Touring-1000 | combines comfort and performance… |
4 | Mountain Bikes | Mountain-500 | this mountain bike has serious racing performance… |
When the user performs a record search on the Description attribute using the keyword comfort, the following objects are returned:
When performing a record search on the Description attribute using the keyword racing, these objects are returned:
There are no Dgraph configuration flags necessary to enable record searching. If an attribute was properly enabled for record searching, it will automatically be available for record searching.
To enable or disable, record searching for a standard attribute, set the property mdex-property_IsTextSearchable to:
The data domain configuration flag:
Although search interfaces are not mandatory for record searches, you have to create a search interface if you want to specify one or more standard attributes to search.
You issue record search queries using the Conversation Web Service API.
The AvailableSearchKeysConfig type identifies the items that are searchable (ie a searchable attribute,property, interfaces)
<ns:AvailableSearchKeysConfig Id="?">
<!--Optional:-->
<ns:StateName>?</ns:StateName>
</ns:AvailableSearchKeysConfig>
Result:
<cs:AvailableSearchKeys>
<cs:AvailableSearchKey Interface="true">
<cs:Key>AllFields</cs:Key>
<cs:DisplayName>AllFields</cs:DisplayName>
</cs:AvailableSearchKey>
<cs:AvailableSearchKey Interface="false">
<cs:Key>Column1</cs:Key>
<cs:DisplayName>Column1</cs:DisplayName>
</cs:AvailableSearchKey>
<cs:AvailableSearchKey Interface="false">
<cs:Key>Column1</cs:Key>
<cs:DisplayName>Column2</cs:DisplayName>
</cs:AvailableSearchKey>
<cs:AvailableSearchKey Interface="false">
<cs:Key>mdex-collection_Key</cs:Key>
<cs:DisplayName>Collection Key</cs:DisplayName>
</cs:AvailableSearchKey>
</cs:AvailableSearchKeys>
where:
A basic record search requires a TextSearchFilter type. The syntax for a search request is shown in this example:
<TextSearchFilter
Key="Prod_Category"
EnableSnippeting="true"
SnippetLength="5"
Mode="AllPartial"
RelevanceRankingStrategy="numfields"
Language="en">
SearchTerm
</TextSearchFilter>
<!-- Key and Search Term are Required -->
where:
Record search works against named collections
<Request>
<State>
<Name>MySalesSearch</Name>
<CollectionName>Sales</CollectionName>
<TextSearchFilter Key="Prod_Category" RelevanceRankingStrategy="numfields"
Mode="AllPartial" EnableSnippeting="true" SnippetLength="5" Language="en">
electronics
</TextSearchFilter>
</State>
<RecordListConfig Id="SalesList" MaxPages="20">
<StateName>MySalesSearch</StateName>
<Column>SalesAmount</Column>
<RecordsPerPage>5</RecordsPerPage>
</RecordListConfig>
</Request>