qwc-services / qwc-docker

Docker containers for qwc-services
MIT License
47 stars 36 forks source link

Multiple `db_url` connection in full-text search #61

Closed lperozzi closed 1 year ago

lperozzi commented 1 year ago

I need to set up a full-text search from multiple data sources. This is fine from the solr side, however I wonder how to define two different db_url to retrieve the geometry

{
  "$schema": "https://raw.githubusercontent.com/qwc-services/qwc-fulltext-search-service/master/schemas/qwc-search-service.json",
  "service": "search",
  "config": {
    "solr_service_url": "http://localhost:8983/solr/gdi/select",
    "word_split_re": "[\\s,.:;\"]+",
    "search_result_limit": 50,
    "db_url": "postgresql:///?service=qwc_geodb"
  },
  "resources": {
    "facets": [
      {
        "name": "background",
        "filter_word": "Background"
      },
      {
        "name": "foreground",
        "filter_word": "Map"
      },
      {
        "name": "ne_10m_admin_0_countries",
        "filter_word": "Country",
        "table_name": "qwc_geodb.search_v",
        "geometry_column": "geom",
        "facet_column": "subclass"
      }
    ]
  }
}

Thanks in advance for your help

pka commented 1 year ago

The db_url in the config section is the default url. You can add resource specific urls by adding a db_url entry in the facets definitions.

pka commented 1 year ago

Reference: https://github.com/qwc-services/qwc-fulltext-search-service/blob/651d79bf99c45c69805c593a2fb534fa12eb68b2/schemas/qwc-search-service.json#L79-L81

lperozzi commented 1 year ago

Wonderful,

many thanks!

HusseinKabbout commented 1 year ago

It seems that this issue has been resolved. Closing this issue.