Page tree
Skip to end of metadata
Go to start of metadata

The Search Engine Independent API Server (SEIA Server) is a central part of the ST Technology Stack. All requests from the user interface are sent to the SEIA server, and the responses are sent back and rendered. The SEIA server is (as its name suggests) search engine-independent; none of its endpoints are tied to a specific search engine. In fact, no endpoint in the SEIA server is actually tied to anything. The SEIA server is completely configurable. Where search engine connectivity is required, this is performed using QPL in JavaScript.



On this page

First steps


The code that is currently available for download and ready to use comes with endpoints, libraries and some code that you might not need for your current project or requirements. So you need to do some cleanup first. 

  1. The first cleanup you must do is remove the endpoints you don't need. You can read more about the endpoint at this page Endpoint Configuration.
    1. The folder is located at server/endpoints. It is as simple as delete the endpoint folders as required. 
    2. If you delete the admin folder, this require a extra step. 
      1. Go the file server/app/server.js and search the following line. Comment out or remove the block of all admin declarations 100 lines approximately.  

        require("../endpoints/admin/thesaurus/models/thesaurus.server.model")(dbConnection);

  2. The next task is to define which Search Engines your application is going to support. In the folder server/engines, discard the engines you don't need. 

  3. To add new endpoints please follow these instructions Endpoint Configuration

  4. To run the server via SSL follow these instructions Enable SSL and Authentication


Getting started with Elasticsearch


  1.  Enable elastic search engine server/engines/elastic.json


    server/engines/elastic.json
    {
      "id": "elastic",
      "enabled": true,
      "implementation": "./qpl-elastic", /* QPL JS Engine specific version */
      "config": {
        "server": "http://localhost:9200",
        "version": 6,
        "serverAuth": "http://user:[email protected]:9200"
      }
    }
  2. Update the server path at config.server
  3. If the server uses basic authentication use the serverAuth fields to setup credentials. Otherwise you can delete it. 
  4. Delete other qpl-engines libraries: server/qpl-google-cloud-search and server/qpl-solr
  5. Make sure all the endpoints uses elasticsearch engine.

    server/endpoints/typeAhead/endpoint.json
    ... 
    "processing": [
        [
          { "label": "typeAhead",
            "engine": "elastic",
    ...
  6. In the folder server/endpoints/search/scripts you will find several scrips files search.js, search_gcs.js. Keep search.js and discard the rest. This script includes a template for searches in Elasticsearch and also it is the most complete. 

Getting started with Solr


  1.  Enable elastic search engine server/engines/solr.json


    server/engines/solr.json
    {
      "id": "solr",
      "enabled": true,
      "implementation": "./qpl-solr",
      "config": {
        "server": "http://localhost:8983/solr"
      }
    }
  2. Update the server path at config.server
  3. Delete other qpl-engines libraries: server/qpl-google-cloud-search and server/qpl-elastic
  4. Make sure all the endpoints uses solr engine. The value must match the id value defined in the engine file. 

    server/endpoints/typeAhead/endpoint.json
    ... 
    "processing": [
        [
          { "label": "typeAhead",
            "engine": "solr",
    ...
  5. In the folder server/endpoints/search/scripts you will find several scrips files search.js, search_gcs.js. Keep search_solr.js and discard the rest. This script includes a template for searches in Solr. You can use as a base to customize your needs. 

Getting started with Google Cloud Search


  1.  Enable elastic search engine server/engines/google_cloud_search.json


    server/engines/google_cloud_search.json
    {
      "id": "google_cloud_search",
      "enabled": true,
      "implementation": "./qpl-google-cloud-search", 
      "config": {    
        "service_account_key": "../PATH_TO_YOUR JSON_KEY",
        "api_version": "v1"    
      }
    }
  2. Update the service key file path at config.service_account_key. This is the account that will be perform the searches. 
  3. Delete other qpl-engines libraries: server/qpl-solr and server/qpl-elastic
  4. Make sure all the endpoints uses Google cloud search engine. The value much match the id value defined in the engine file. 

    server/endpoints/typeAhead/endpoint.json
    ... 
    "processing": [
        [
          { "label": "typeAhead",
            "engine": "google_cloud_search",
    ...
  5. In the folder server/endpoints/search/scripts you will find several scripts files search.js, search_gcs.js. Keep search_gcs.js and discard the rest. This script includes a template for searches in Google Cloud Search. In this case the use of QPL is minimum. There is few flexibility this search engine allow us to do. Most of the times it is better to send the query text without modifications. You can find more details about the query syntax in this link: https://support.google.com/a/users/answer/9299929 

Configure the autosuggestion feature


Configuration is done through the Search endpoint (server\endpoint\typeAhead\ endpoint.json)


  • No labels