Class GrpcSearchService

java.lang.Object
org.saidone.unrest.api.SearchServiceGrpc.SearchServiceImplBase
org.saidone.unrest.platform.GrpcSearchService
All Implemented Interfaces:
io.grpc.BindableService, org.saidone.unrest.api.SearchServiceGrpc.AsyncService

public final class GrpcSearchService extends org.saidone.unrest.api.SearchServiceGrpc.SearchServiceImplBase
Adapts Alfresco's search service to paged, permission-filtered gRPC queries.

Queries target the workspace store and support AFTS and CMIS SQL. AFTS accepts an ordered list of property or relevance sort fields; CMIS sorting belongs in the query's ORDER BY clause. Search results reflect the index and may lag repository writes. Nodes deleted since indexing are omitted from the returned entries.

Queries run in a read-only transaction as the authenticated caller. The backing result set is always closed, including when node mapping fails.

See Also:
  • SearchService
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrpcSearchService(org.alfresco.service.ServiceRegistry services)
    Creates the adapter and its repository helpers without starting repository work.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    query(org.saidone.unrest.api.SearchRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.SearchResponse> observer)
    Runs a permission-filtered query against the workspace store.

    Methods inherited from class org.saidone.unrest.api.SearchServiceGrpc.SearchServiceImplBase

    bindService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GrpcSearchService

      public GrpcSearchService(org.alfresco.service.ServiceRegistry services)
      Creates the adapter and its repository helpers without starting repository work.
      Parameters:
      services - Alfresco service registry; repository work uses its secured services
  • Method Details

    • query

      public void query(org.saidone.unrest.api.SearchRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.SearchResponse> observer)
      Runs a permission-filtered query against the workspace store. Language defaults to afts; cmis is also accepted. The query must contain 1..4096 characters and a page must contain 1..1000 entries (zero selects 100).

      AFTS accepts up to ten ordered property/relevance sort fields. CMIS queries must use ORDER BY instead. Invalid queries or sort fields yield INVALID_ARGUMENT. Indexed nodes that no longer exist are omitted without recomputing the search engine's total count. An absent fields mask selects name, type and properties; a single * returns complete nodes. An empty mask selects references only. Selection skips omitted metadata reads without changing the secured query or result ordering.

      Parameters:
      request - query text, language, pagination, optional ordered AFTS sort fields and Node field mask
      observer - receives one result page with matching node snapshots, total count and continuation flag, or a gRPC error