Show / Hide Table of Contents

Class FreetextMatchCalculator

This is a utility class to perform an actual freetext search, for single or multiple words. It returns sets of ids that indicate the matches, and can also consolidate such sets into counts.

Inheritance
Object
FreetextMatchCalculator
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public static class FreetextMatchCalculator

Methods

CalculateMatches(String[], String[], Nullable<Int32>, Nullable<Int32>, Boolean)

Perform a freetext search and return the ids of the matching owners

Declaration
public static Dictionary<int, List<int>> CalculateMatches(string[] wordList, string[] owners, int? searchOp = default(int? ), int? hitLim = default(int? ), bool soundex = false)
Parameters
Type Name Description
String[] wordList

Array of words to search for, with an implicit AND between them: ["foo", "bar"]

String[] owners

Array of owner table names to search: ["contact", "sale"]

Nullable<Int32> searchOp

Override search operator: 1 = contains, 2 = starts with, 3 = exact match. Default to preference values

Nullable<Int32> hitLim

Max number results to return. Defaults

Boolean soundex
Returns
Type Description
Dictionary<Int32, List<Int32>>

Dictionary indexed by owner entity table number; value is a dictionary of ids (with no subvalues, the dictionary class is used to ensure a unique id list)

Remarks

Search words are first matched against the stopword list and stopwords removed. If no valid words are left, the search terminates with 0 matches. Then, a match id list is built for each word, and the intersection of the lists calculated. The search terminates when all words have been processed, or when the intersection is empty.

GroupMatches(Dictionary<Int32, List<Int32>>)

Consolidate a match list dictionary into a dictionary of owner table ids and counts

Declaration
public static Dictionary<int, int> GroupMatches(Dictionary<int, List<int>> matches)
Parameters
Type Name Description
Dictionary<Int32, List<Int32>> matches
Returns
Type Description
Dictionary<Int32, Int32>

TableNumberToLocalizedName(Int32)

Map the knwon, standard freetext owner entities into localized resources names

Declaration
public static string TableNumberToLocalizedName(int tableNumber)
Parameters
Type Name Description
Int32 tableNumber
Returns
Type Description
String
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top