This service is responsible for searching for all resources in FDK. The service consumes RDF parse events (Kafka)
and indexing these resources as documents (SearchObject
s) in ElasticSearch.
Open-API spec: https://github.com/Informasjonsforvaltning/fdk-search-service/blob/main/openapi.yaml
The generalized model is used to represent all resources in FDK, with fields that are common to all resources, and used for searching.
The result of search queries is represented by the SearchResult
model. This model contains paginated list of
SearchObject
s.
- maven
- java 21
- docker
- docker-compose
mvn generate-sources
mvn test
Topics and schemas are set up automatically when starting the Kafka cluster. Docker compose uses the scripts create-topics.sh and create-schemas.sh to set up topics and schemas.
docker-compose up -d
If you have problems starting kafka, check if all health checks are ok. Make sure number at the end (after 'grep') matches desired topics.
Start search service locally using maven. Use Spring profile develop.
mvn spring-boot:run -Dspring-boot.run.profiles=develop
Check if schema id is correct in the produce-messages.sh script. This should be 1 if there is only one schema in your registry.
sh ./kafka/produce-messages.sh
For more usages, see openAPI spec.
URL: https://search.api.staging.fellesdatakatalog.digdir.no/search
URL: https://search.api.staging.fellesdatakatalog.digdir.no/search/[resourceType]
URL: https://search.api.staging.fellesdatakatalog.digdir.no/search/datasets
Payload:
{
"query": "test",
}
Payload:
{
"pagination": {
"size": 5,
"page": 2
}
}
Payload:
{
"sort": {
"field": "FIRST_HARVESTED",
"direction": "DESC"
}
}
Payload:
{
"filters": {
"accessRights": {
"value": "RESTRICTED"
},
"dataTheme": {
"value": [
"REGI"
]
},
"losTheme": {
"value": [
"familie-og-barn"
]
}
}
}