Home > Contents > Index >
SEARCHSTATE.ADDRICHTEXTCONSTRAINT
Adds an index name and rich-text expression to the list of rich-text criteria for items.
Syntax
<SEARCHSTATE.ADDRICHTEXTCONSTRAINT
NAME="ssname
" [BUCKET="bucketname
"] [TYPENAME="assettype
"] ATTRIBUTE="attribname
" VALUE="criteria
" [PARSER="parsername
"] CONFIDENCE="minlevel
" [MAXCOUNT="number
"] />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. The internal asset name for the attribute (either
CAttributes
for content attribute, orPAttributes
for product attribute). If you do not specifyTYPENAME
, a value is supplied from a property in thegator.ini
property file:mwb.defaultattributes=PAttributes.
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.
VALUE
(required)- Input parameter. The rich-text search criteria, which should apply to the attribute.
PARSER
(optional)- Input parameter. The search-engine-dependent rich text parser to use.
CONFIDENCE
(required)- Input parameter. The minimum confidence level for the match. This parameter is search engine dependent; adjust the value lower if you are not getting the desired results.
MAXCOUNT
(optional)- Input parameter. The 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 object described by the
NAME
parameter is updated to reflect the additional 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.
Note
This tag requires that the attribute was created as indexed.
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"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>See Also
SEARCHSTATE.CREATE
SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT
SEARCHSTATE.ADDRANGECONSTRAINT
ASSETSET.SETSEARCHEDASSETS
ASSETSET.GETATTRIBUTEVALUES
Home > Contents > Index > ![]()
FatWire XML Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.