Configuring the locations of the Discovery Service and IQ Query Service in the Java/JSP web application
To enable the IQ Query Client to connect to the Discovery Service (and the Capabilities it exposes) to be found, configure the location of the Discovery Service in the search client configuration file, udp-search-conf.xml.
Procedure
- In the configuration directory of the web application, open udp-search-conf.xml for editing.
- Ensure that the file contains a root-level element called
ServiceConfig, for example, the following one:<ServiceConfig Version="10.0" xsi:noNamespaceSchemaLocation="schemas/udp-search-conf.xsd" ConnectionTimeout="${indexconnectiontimeout:-10000}" ReadTimeout="${indexreadtimeout:-30000}" WriteTimeout="${indexwritetimeout:-30000}" MaxIdleConnection="${indexmaxidleconnections:-30}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <DiscoveryService ServiceUri="${discoveryurl:-http://localhost:8082/discovery.svc" /> <TokenService ClientId="${clientid:-cduser}" ClientSecret="${clientsecret:-encrypted:PASSWORD}" />where PASSWORD is the encrypted password that
cduseruses to connect to the Discovery Service - Only if you are using the Search feature without using the Discovery Service, uncomment the
QueryServiceelement, and configure the URL of the IQ Query Service endpoint separately in itsServiceUriattribute. - If your Elasticsearch index for Content Delivery content does not have the default name,
udp-index, set the custom index name in theIndexNameattribute of theDefaultIndexelement. - The udp-search-conf.xml that ships with your product is set up to support the Java class
com.sdl.delivery.iq.query.client.rest.RestQueryClientfor querying. Use this class if your client communicates with Elasticsearch through the IQ Query Service from Content Delivery, rather than directly. Alternatively, if your client communicates directly with Elasticsearch, in theQueryClientelement, change theClassattribute to the valuecom.sdl.delivery.iq.query.client.embedded.EmbeddedQueryClient. - If you are connecting to Elasticsearch directly, also create a child section to the
QueryClientelement and call itQueryProvider, with aTypeattribute set to the valueelasticsearch. Then create a child element toQueryProviderand call itProperties. Within thisPropertiessection, add multiplePropertychild elements, each with aNameattribute and aValueattribute, configured as follows:NamevalueDescription of Valuevaluees.hostThe Elasticsearch host name es.portThe Elasticsearch port number (you can omit this property if the value is 9200) es.ingest.hostThe Elasticsearch ingest node host name es.ingest.portThe Elasticsearch ingest node port number (you can omit this property if the value is 9200) es.usernameIf you use Basic Authentication (typical when connecting to Elastic Cloud), a valid username for accessing the Elasticsearch instance es.passwordIf you use Basic Authentication (typical when connecting to Elastic Cloud), a valid password for the username provided above es.ingest.usernameIf you use Basic Authentication (typical when connecting to Elastic Cloud), a valid username for accessing the Elasticsearch ingest node es.ingest.passwordIf you use Basic Authentication (typical when connecting to Elastic Cloud), a valid password for the username provided above - Save and close udp-search-conf.xml.
Related concepts