Release 1.3 - ...
<searchbase> element
The searchbase element defines the (search)query which must be used when building a query for a particular source.
It also contains an optional weights element, which can be used to assign field-weights to certain fields.
The optional name attribute should be used when you want to include multiple searchbase elements. The (optional) type attribute must be included and set to "native" when the query child-element contains a query which must use "native" syntax (LIKE statements).
Example
XML |
Copy Code
|
<searchbase>
<weights default="1" agefactor="0.05" seopriority="200"
contenttypeweight="200" popularityweight="300" />
<query><![CDATA[
SELECT [KEY] AS Nr, (RANK {sys.iif(this.isbasequery(),
"+" + this.seopriority("c.seopriority") +
"+" + this.contenttypeweight("c.contenttype_weight") +
"+" + this.popularityweight("LOG(ISNULL(pr.visits,1))/LOG(" + sys.eval(maxvisits(), smartlet.number()) + ")"))})
* {this.fieldweight("dbo.fn_tsAgeInDays(c.moddate)", default="(c."+this.fieldname()+"_weight - 1)")} AS SearchRank,
{sys.iif(this.isbasequery() || this.mode()!=SearchQuery, '1', 'NULL')} AS BaseSearch
FROM CONTAINSTABLE({this.searchgroupviewname()}, {this.fieldname(default="(QueryData,CTSpecificBinary1)")}, ?:searchterm)
JOIN {this.searchgroupviewname()} c WITH (NOEXPAND) ON [KEY]=c.Nr
{sys.iif(this.isbasequery(), "LEFT JOIN PageRequests pr ON c.Nr=pr.Nr")}
{sys.iif(!this.isbasequery() AND this.mode()==SearchQuery,
"WHERE " + this.fieldweight("",default="c."+this.fieldname()+"_weight") + ">1")}
]]>
</query>
</searchbase>
|
Attributes
Attribute name |
Required |
Description |
name |
No |
Name of the searchbase. |
type |
No |
The type of query that should be generated. Allowed values:
- fulltext (default)
- native
- thesaurusrelation
When queries using native syntax (LIKE statements) must be generated, add this attribute and set it to native. When the searchbase represents a thesaurus relation you must add this attribute and set it to thesaurusrelation. Notice that in that case, it is also required to specify the thesauruscode, baserank and weightfactor attributes. |
thesauruscode |
No |
The code of the thesaurus for which thesaurus relation queries must be generated.
Only applicable when the type attribute has been set to thesaurusrelation. |
baserank |
No |
The base rank which should be used for items matching a thesaurus relation (for the specified thesaurus code) which equals (one of) the search term(s).
Only applicable when the type attribute has been set to thesaurusrelation. |
weightfactor |
No |
The multiplier which must be applied to the base rank for items matching a "narrower term" thesaurus relation (for the specified thesaurus code) which equals (one of) the search term(s).
Only applicable when the type attribute has been set to thesaurusrelation. |
Parent element
Element name |
Description |
<searchbases> |
Parent element for one ore more searchbase element(s). |
Child elements
Element name |
Description |
<query> |
Defines the (main) search query for a particular source. |
<weights> |
Defines ranking multiplier(s) and ranking addition(s). |
<searchprofiles> |
Parent element for one or more searchprofile elements.
|
<wherefields> |
Defines the default search fields. |