This section describes search index configuration and how to export, create, replace, and modify it.
The Search and Navigation API enables you to configure the locales of an application.
You configure locales by setting appropriate values for the JSON
attributes
defaultLocale
and
locales
.
The Search and Navigation API also enables you to configure other attributes that specify the types of words that can appear in the spelling dictionary, as well as whether the asterisk (*) is supported as a wildcard character in dimension searches. Note, however, that Oracle recommends that you not modify the default settings for these attributes unless you are instructed to do so by Oracle Technical Support.
Important: Deleting the search index configuration will make your application unusable.
Locales are configured through attributes of the
search-index-config
object. The following table gives an
overview of these attributes.
Attribute |
Supported values |
Description |
|
|
Indicates that this configuration is for Search Index Configuration. |
|
STRING |
Optional. The default locale for the application. Must be a valid IETF BCP 47 locale code. If no value for
|
|
MULTI VALUED STRING |
Optional. The locales supported for this application. Must be valid IETF BCP 47 locale codes. |
|
INTEGER |
Optional. Specifies the minimum number of times the word must appear in the source data before the word should be included in the spelling dictionary. Note: Do not modify the value of this attribute unless instructed to do so by Oracle Technical Support. |
|
BOOLEAN |
Optional. Indicates that the asterisk (*) can be used as a wildcard character to match fragments of words in dimension values. Note: Do not modify the value of this attribute unless instructed to do so by Oracle Technical Support. |
|
INTEGER |
Optional. Specifies the maximum length of a word that should be included in the spelling dictionary. Applies to both dimension search and record search. Note: Do not modify the value of this attribute unless instructed to do so by Oracle Technical Support. |
|
INTEGER |
Optional. Specifies the minimum character length for a word to be included in the spelling dictionary. This setting applies to both dimension search and record search. Note: Do not modify the value of this attribute unless instructed to do so by Oracle Technical Support. |
The following sample JSON object illustrates the syntax of search index attributes.
{ "ecr:type" : "search-index-config", "defaultLocale" : "en", "locales" : [ "en-GB", "fr-CA", "de", "es" ], "spellingDictMaxWordLength" : 16, "spellingDictMinNumWordOccurrences" : 4, "spellingDictMinWordLength" : 4, "isWildcardEnabledInDimensionSearch" : true }
You can export locale configuration locally in order to view it,
modify it, or archive it. The locale configuration is exported in a
search-index-config
object.
To export locale configuration locally, execute a command of the following form:
runcommand.bat IFCR exportContent searchIndexConfig directory
where
directory
identifies the directory to which the
ZIP file containing the configuration is exported. Do not specify a file name
for exported content.
The following example illustrates the JSON configuration of a
search-index-config
object that can be exported by the
command above:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-05-24T17:10:24.914z", "ecr:createDate": "2016-01-13T08:21:15.372z", "ecr:type": "search-index-config", "defaultLocale": "en-US", "locales": [ "de", ], "spellingDictMaxWordLength": 16, "spellingDictMinNumWordOccurrences": 4, "spellingDictMinWordLength": 4, "isWildcardEnabledInDimensionSearch": true }
You can import locale configuration locally in order to create it
or modify it. Locales are configured through attributes of the
search-index-config
object.
If search index configuration has been deleted or is missing for any
other reason, you can use the
importContent
command to re-create it.
To create search index configuration locally, use a command of the following form:
runcommand.bat IFCR importContent searchIndexConfig pathname\file.zip
where
pathname\file.zip specifies the location and name of the
ZIP file that contains the configuration. The ZIP file must contain a file
named
_.json
that contains the JSON configuration of the
search-index-config
object.
For example, the following JSON sample illustrates a configuration of
the
search-index-config
object that can be imported by the
command above:
{ "ecr:type" : "search-index-config", "defaultLocale" : "en", "locales" : [ "en-GB", "fr-CA", "de", "es" ], "spellingDictMaxWordLength" : 16, "spellingDictMinNumWordOccurrences" : 4, "spellingDictMinWordLength" : 4, "isWildcardEnabledInDimensionSearch" : true }
You can replace or modify existing locale configuration locally using
importContent
command in the same way that you use
this command to create locale configuration. In all cases -- create, replace,
and modify -- the imported configuration entirely replaces the existing
configuration, if any.
You can export locale configuration remotely in order to view it,
edit it, or archive it on your file system. The locale configuration is
exported in a
search-index-config
object.
To export locale configuration remotely, execute a GET request of the following form:
GET http://host:port/ifcr/gsadmin/v1/Discover/searchIndexConfig
where
host:port
identifies the machine on
which Guided Search is installed.
The following example illustrates the JSON representation of a search index configuration that can be exported by the GET request above:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-05-24T17:10:24.914z", "ecr:createDate": "2016-01-13T08:21:15.372z", "ecr:type": "search-index-config", "defaultLocale": "en-US", "locales": [ "de", ], "spellingDictMaxWordLength": 16, "spellingDictMinNumWordOccurrences": 4, "spellingDictMinWordLength": 4, "isWildcardEnabledInDimensionSearch": true }
You can import locale configuration to create, replace, or modify the configuration.
If the search index configuration has been deleted or is missing for any other reason, use the POST method to re-create it.
To import locale configuration, use a command of the following form:
POST http://host:port/ifcr/gsadmin/v1/Discover/searchIndexConfig
where
host:port
identifies the machine on which
Guided Search is installed.
For example, the following JSON illustrates the configuration of a
search-index-config
object that can be imported by the
POST request above:
{ "ecr:type" : "search-index-config", "defaultLocale" : "en", "locales" : [ "en-GB", "fr-CA", "de", "es" ], "spellingDictMaxWordLength" : 16, "spellingDictMinNumWordOccurrences" : 4, "spellingDictMinWordLength" : 4, "isWildcardEnabledInDimensionSearch" : true }
You can replace existing locale configuration using the PUT method.
The PUT method imports an entire
search-index-config
object and all its attributes; it
cannot import particular attributes of that object. To modify existing search
index configuration by adding attributes to locale configuration, or changing
values of existing attributes, use the PATCH method.
Note
The PUT method is supported only in JSON format.
To replace a search index configuration, use a PUT request of the following form:
PUT http://host:port/ifcr/gsadmin/v1/Discover/searchIndexConfig
where host:port identifies the machine on which Guided Search is installed.
For example, the imported
search-index-config
object can be configured as
follows:
{ "ecr:type": "search-index-config", "defaultLocale": "de", "locales": [ "en-UK", "es" ], "spellingDictMaxWordLength": 16, "spellingDictMinNumWordOccurrences": 4, "spellingDictMinWordLength": 3, "isWildcardEnabledInDimensionSearch": true }
You can modify locale configuration by using the PATCH method to
modify values of attributes of the
search-index-config
object.
Note
The PATCH method is supported only in JSON format.
To modify locale configuration, use a PATCH request of the following form:
PATCH http://host:port/ifcr/gsadmin/v1/Discover/searchIndexConfig
where host:port identifies the machine on which Guided Search is installed.
For example, suppose that the
search-index-config
object is currently configured as
follows:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-01-13T08:21:15.372z", "ecr:createDate": "2016-01-13T08:21:15.372z", "ecr:type": "search-index-config", "spellingDictMaxWordLength": 16, "spellingDictMinNumWordOccurrences": 4, "spellingDictMinWordLength": 4, "isWildcardEnabledInDimensionSearch": true }
You can add the language configuration by executing the PATCH endpoint above with the following input:
{ "ecr:type": "search-index-config", "defaultLocale": "en-US", "locales": [ "en-UK", "de", "es" ] }
The search index configuration is now configured as follows:
{ "ecr:lastModifiedBy": "admin", "ecr:lastModified": "2016-01-13T08:21:15.372z", "ecr:createDate": "2016-01-13T08:21:15.372z", "ecr:type": "search-index-config", "defaultLocale": "en-US", "locales": [ "en-UK", "de", "es" ], "spellingDictMaxWordLength": 16, "spellingDictMinNumWordOccurrences": 4, "spellingDictMinWordLength": 4, "isWildcardEnabledInDimensionSearch": true }
You can also use PATCH to modify the value of existing attributes.
For example, to change the supported locale from
es
to
fr
, you can execute the PATCH method with the
following input:
{ "locales": [ "en-UK", "de", "fr" ], "ecr:type": "search-index-config" }