Release 1.3 - ...
<searchbases> element
The searchbases element is the root element for one or more searchbase elements.
You can define multiple searchbase elements for a particular source, e.g. to be able to switch between fulltext and native queries using the same query xml configuration.
Which searchbase element will be used depends on the SearchBaseName property of either the indexedsearch.prepareinputdata or the indexedsearch.querybuilder macro. When the SearchBaseName property is null or empty, the first searchbase element will be used. Otherwise, it must equal the name-attribute of an searchbase element.
Example
XML |
Copy Code
|
<searchbases>
<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>
<searchbase name="like" type="native">
<weights default="1">
<field name="c.title" weight="4" />
<field name="c.description" weight="2" />
</weights>
<query><![CDATA[
SELECT c.Nr, {this.rankingstatment(content)}*100 as SearchRank
FROM {this.searchgroupviewname()} c WITH (NOEXPAND)
WHERE {this.searchcondition(content)}
]]>
</query>
<wherefields>c.title,c.description,c.querydata</wherefields>
</searchbase>
</searchbases>
|
Attributes
None.
Parent element
Element name |
Description |
<source> |
Element defining configuration for a specific source. |
Child elements
Element name |
Description |
<searchbase> |
Defines the configuration for a searchbase. |