Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
searchstate:addrichtextconstraint
Adds a constraint based on an index name and rich-text expression to a searchstate.
Syntax
<searchstate:addrichtextconstraint
name="ssname
" [bucket="bucketname
"] [typename="assettype
"] attribute="attribname
" value="criteria
" [parser="parsername
"] confidence="minlevel
" [maxcount="number
"]/>
Note
This tag requires that the attribute was created as indexed.
Parameters
name
(required)- Input parameter. Name of an object representing a searchstate.
bucket
(optional)- Input parameter. Bucket name. If not specified, the attribute name is used. Use this parameter to indicate which constraint you need when the same attribute is used in multiple contstraints. A bucket is an alias and functions similar to an inner join in SQL; when you have multiple tables that have columns of the same name, you must specify the table name to indicate which column you are requesting.
typename
(optional)- Input parameter. Internal asset type name for the attribute (either
CAttributes
for content attribute, orPAttributes
for product attribute). If you do not specifyTYPENAME
, a default value is picked up from a property in thegator.ini
property file:mwb.defaultattributes
. The default value is set to bePAttributes
and may be changed to be the name of any custom attribute asset types you create.
attribute
(required)- Input parameter. Name of the attribute to constrain. This attribute must be created as indexed.
value
(required)- Input parameter. Rich-text search criteria, which should apply to the attribute.
parser
(optional)- Input parameter. Search-engine-dependent rich text parser to use.
confidence
(required)- Input parameter. Minimum confidence level for the match. The range of this value is from 0.0 to 1.
maxcount
(optional)- Input parameter. Maximum number of answers desired for the match. If this parameter is not specified, the number of results is limited only by the confidence and the number of products.
Description
The searchstate described by the
name
parameter is updated to add this rich-text search criteria. If the attribute name is already mentioned as part of a rich-text constraint in the searchstate, then the existing constraint is removed first.errno
The possible values of
errno
include:
Value Description -10004 A required parameter is missing. -13050 General error. -13104 No index for attribute or search engine indexed attribute is missing its indices.Example
This code creates an empty
searchstate
and adds a richtext constraint. The constraint sets a rich-text search expression on theattribute
being searched on. The constraint of.LU.
will work with the Verity search engine to match any string havingLU
between two other characters. In general, the form of thevalue
attribute depends on the search engine used to index the specified attribute.
Thetypename
parameter is not specified and the default attribute type set ingator.ini
is picked up. Any assets with matching values for this attribute will be returned. This code then sets thissearchstate
into anassetset:setsearchedassets
tag to constrain theassetset
to be used when searching with other assetset tags. The lastassetset
tag uses this constrained assetset to search for matching assets and fetch a list of actual values for theattribute
of the returned assets:<searchstate:create name="ss" /> <searchstate:addrichtextconstraint name="ss" attribute="productdesc" value=".LU." confidence="0.001"/> <assetset:setsearchedassets name="as" constraint="ss" assettypes="Products"/> <assetset:getattributevalues name="as" attribute="productdesc" listvarname="resultlist"/> <ics:listloop listname="resultlist"> <ics:listget listname="resultlist" fieldname="value"/><br/> </ics:listloop>See Also
searchstate:create
searchstate:addsimplestandardconstraint
searchstate:addrangeconstraint
assetset:setsearchedassets
assetset:getattributevalues
Home > Contents > Index > ![]()
FatWire JSP Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.