@ View ( name = "by_serviceName" , map = "function(doc) { if (doc.service) { emit(doc.service.name, doc._id) }}" ) public RegisteredServiceDocument findByServiceName ( final String serviceName ) { try { return queryView ( "by_serviceName" , serviceName ) . stream ( ) . findFirst ( ) . orElse ( null ) ; } catch ( final DocumentNotFoundException e ) { LOGGER . debug ( "Service [{}] not found. [{}]" , serviceName , e . getMessage ( ) ) ; return null ; } }
Implements search by service name .