Skip to main content

%Library.TextStreamInterface

class %Library.TextStreamInterface extends %Compiler.Type.StreamEmbedded

Method Inventory

Parameters

parameter LANGUAGECLASS = %Text.English;

The LANGUAGECLASS parameter specifies the fully qualified name of the language implementation class. Optionally, he LANGUAGECLASS may be set to the name of a global that indirectly defines the language class name. If a global name is specified, then the global must be defined and available at index build time and at SQL query execution time.

parameter SIMILARITYINDEX;
Specify the SIMILARITYINDEX parameter when you intend to use the %SIMILARITY SQL operator to rank query results by relevance.

The SIMILARITYINDEX parameter specifies the name of an index on the current property that has the structure expected by the SimilarityIdx class method of the class specified in the LANGUAGECLASS parameter. The SimilarityIdx class method in the %Text.Text class requires the index global to have the structure: ^textIndexGlobal([constantSubscripts,]key,ID) = value. An index with this structure can be created by compiling an index specification such as:

PROPERTY myDocument As User.TextStream (LANGUAGECLASS = "%Text.English", SIMILARITYINDEX = "myIndex");
INDEX myIndex ON myDocument(KEYS) DATA [ myDocument(VALUES) ];
The SimilarityIdx method of the %Text.Text class requires the index specified in the SIMILARITYINDEX parameter to have exactly this structure. The index may not be a bitmap index, additional subscripts or data values may not be added to the Index specification, and the index must inherit the collation of the property.

Methods

classmethod BuildValueArray(document As %Binary, ByRef valueArray As %Binary) as %Status
classmethod ChooseSearchKey(searchString As %String) as %String
classmethod CreateQList(searchPattern As %String, collationExpr As %String) as %List
classmethod MakeSearchTerms(searchPattern As %String, ngramlen As %Integer = 0) as %List
classmethod Similarity(document As %String, qList As %List) as %Numeric
classmethod SimilarityIdx(ID As %String, textIndex As %String, qList As %List) as %Numeric
classmethod Standardize(document As %String, origtext As %Boolean = 0) as %String

Inherited Members

Inherited Methods

FeedbackOpens in a new tab