Public JSON Formats for
Thesaurus
This section
describes the public JSON formats of Thesaurus configuration.
Properties in the JSON file:
Attribute
|
Value
|
---|
ecr:type
|
The ecr-type of the node. The
value can be thesaurus or thesaurus-entry. Required.
|
ecr:createDate
|
yyyy-MM-dd'T'HH:mm:ss.SSSX.
Optional. Date and time that this item was created. Defaults to creation date
of the JCR.
|
id
|
Can be generated
automatically or specified by the user. Required for operations on a thesaurus
entry.
|
thesaurus-entries
|
One or more entries. Each
entry has the following attributes:
|
Attribute
|
Type
|
Required
|
Value
|
type
|
string
|
yes
|
one-way:
Specifies a single synonym for the searchTerms value. The word configured as
the searchTerm matches the synonym wherever it occurs in your records. However,
a word configured as a synonym, if entered as a search term, will not match the
word configured as a search term.
multi-way:
Specifies a list of synonyms, any one of which, if entered as the search term,
will match any other synonym wherever it occurs in your records.
|
searchTerms
|
string
| |
Required if the type value is one-way. Not
used if the entry type is multi-way.
|
synonyms
|
string or string[]
|
yes
|
If type is
one-way, a single string that is considered a match for the searchTerm value.
If type is
multi-way, a set of two or more strings, any one of which is considered a match
for any of the others when entered by the user as a search term.
|
The following example illustrates the exported JSON format for a
one-way thesaurus entry (the search term "digital" matches "digi" in your
records), and a multi-way thesaurus entry ("converter", "adapter", and
"adapter-converter" all match each other):
{
"ecr:type" : "thesaurus",
"ecr:createDate": "2016-10-17T11:40:26.766Z",
"<auto_generated_id>":
{
"ecr:type": "thesaurus-entry",
"type": "one-way",
"searchTerms": "digital",
"synonyms" : ["digi"]
},
"<user_specified_id>":
{
"ecr:type": "thesaurus-entry",
"type": "multi-way",
"synonyms": [
"converter","adapter","adapter-converter"
]
}
}