The main search service is an Elasticsearch proxy taking care of user privileges.
1.3K
The main search service is an Elasticsearch proxy taking care of user privileges.
This main searcher is always in charge of searches and can be decorated to accept custom search API and custom response format. For this, 3 types of searcher can be defined and the following examples are provided:
Query as usually expressed using the Elasticsearch API but a searcher can customize this and take URL parameter and build the corresponding query (eg. RSS searcher).
The main searcher is the fastest option and does not require any database connection.
Remaining topics to work on:
Start the service with other microservices:
docker-compose up -d elasticsearch rabbitmq discovery
docker-compose up -d config
docker-compose up -d gateway auth
mvn spring-boot:run -Dspring-boot.run.profiles=dev,local -f modules/services/searching/
Start the service in standalone mode (see bootstrap.yml for the configuration) from the root project folder using:
# Without security
SERVER_PORT=9902 mvn spring-boot:run -Dspring-boot.run.profiles=standalone,local -f modules/services/searching
# With security
SERVER_PORT=9902 mvn spring-boot:run -Dspring-boot.run.profiles=local -f modules/services/searching
In standalone mode, the service requires an Elasticsearch instance and database running.
Test the search:
# Elasticsearch service
curl 127.0.0.1:9902/portal/api/search/records/_search \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"from": 0, "size": 10, "query": {"query_string": {"query": "+isTemplate:n"}}}' | jq -r '.hits.total.value'
https://github.com/geonetwork/geonetwork-microservices/tree/main/modules/services/searching
Content type
Image
Digest
sha256:1329e12e2…
Size
179.8 MB
Last updated
over 1 year ago
docker pull geonetwork/gn-cloud-searching:4.4.7-0