Skip to main content
Version: 2025.1

SuggestTagConfig

Configuration object for a lookup of global hashtags. It provides more options to provide more precise suggestions for existing tags.

Methods​

addFilterExcludedTags​

addFilterExcludedTags(pFilterExcludedTags): SuggestTagConfig

Adds global tags which must not be present in combination with the suggestions in a record.

Parameters​

pFilterExcludedTags
string[]

the excluded tags

Returns​

SuggestTagConfig

suggestTagConfig


addFilterIncludedTags​

addFilterIncludedTags(pFilterIncludedTags): SuggestTagConfig

Adds global tags which must be included in combination with the suggestions, with at least one record together. By default, all included tags are linked with an AND operator. This can be changed to OR by using isMatchAllIncludedTags(true).

Parameters​

pFilterIncludedTags
string[]

Returns​

SuggestTagConfig

suggestTagConfig


getFilterExcludedTags​

getFilterExcludedTags(): string[]

Returns the global tags which must not be present in combination with the suggestions in a record.

Returns​

string[]

an array of global tags that must not be present in combination with the suggestions.


getFilterIncludedTags​

getFilterIncludedTags(): string[]

Returns the global tags which must be included in combination with the suggestions, with at least one record together. By default, all included tags are linked with an AND operator. This can be changed to OR by using isMatchAllIncludedTags(true).

Returns​

string[]

an array of global tags that must be present in combination with the suggestions.


getLimit​

getLimit(): number

Returns the maximum number of returned suggestions. Default is NULL, or no limit.

Returns​

number

the maximum number of returned suggestions.


getPattern​

getPattern(): string

Returns the current search term for which suggestions should be returned.

Returns​

string

current search term.


isIncludeCounts​

isIncludeCounts(): boolean

If true the overall count for each suggested tag will be included in the result. Default is false.

Returns​

boolean

true if counts for each suggested tag should be returned.


isMatchAllIncludedTags​

isMatchAllIncludedTags(): boolean

Specifies whether all included global tags for a proposal must be present in at least one record. Default is true. If set to false, at least one included tag must be present.

Returns​

boolean

true if all included global tags must be present.


setFilterExcludedTags​

setFilterExcludedTags(pFilterExcludedTags): SuggestTagConfig

Sets the global tags which must not be present in combination with the suggestions in a record.

Parameters​

pFilterExcludedTags
string[]

the excluded tags

Returns​

SuggestTagConfig

suggestTagConfig


setFilterIncludedTags​

setFilterIncludedTags(pFilterIncludedTags): SuggestTagConfig

Sets the global tags which must be included in combination with the suggestions, with at least one record together. By default, all included tags are linked with an AND operator. This can be changed to OR by using isMatchAllIncludedTags(true).

Previous values are overridden.

Parameters​

pFilterIncludedTags
string[]

Returns​

SuggestTagConfig

suggestTagConfig


setIncludeCounts​

setIncludeCounts(pIncludeCounts): SuggestTagConfig

If true the overall count for each suggested tag will be included in the result. Default is false.

Parameters​

pIncludeCounts
boolean

true if counts for each suggested tag should be returned.

Returns​

SuggestTagConfig

suggestTagConfig


setLimit​

setLimit(pLimit): SuggestTagConfig

Sets the maximum number of returned suggestions. Default is NULL, or no limit.

Parameters​

pLimit
number

Returns​

SuggestTagConfig

suggestTagConfig


setMatchAllIncludedTags​

setMatchAllIncludedTags(pMatchAllIncludedTags): SuggestTagConfig

Specifies whether all included global tags for a proposal must be present in at least one record. Default is true. If set to false, at least one included tag must be present.

Parameters​

pMatchAllIncludedTags
boolean

true if all included global tags must be present.

Returns​

SuggestTagConfig

suggestTagConfig


setPattern​

setPattern(pPattern): SuggestTagConfig

Sets the current search term for which suggestions should be returned.

Parameters​

pPattern
string | number | boolean

Returns​

SuggestTagConfig

suggestTagConfig

Example​

<code>
var stc = tag.createSuggestTagConfig()
.setPattern("adi")
.setLimit(3) // Sets max amount of returned suggestions. (Default is 10)
.setIncludeCounts(true); // Falg, which activates the determination of hashtag counts.

var res = tag.suggestHashtags(stc);

if( res.length &gt; 0 )
{
var topTag = res[0].tag; // The suggested hashtag.
var weight = res[0].weight; // The relevance of the suggestion.
var count = res[0].count; // The usage of the tag. '-1' if disabled (default).
}

// Example of the returned array:
// [
// {
// "tag":"ADITO",
// "weight":10,
// "count":25
// },
// {
// "tag":"Neon ADITO",
// "weight":8,
// "count":7
// }
// ]

</code>