code: private void beginSearch() throws RemoteException {
          org.fcrepo.server.types.gen.FieldSearchQuery genFieldSearchQuery =
                  TypeUtility.convertFieldSearchQueryToGenFieldSearchQuery(query);
          org.fcrepo.server.types.gen.FieldSearchResult searchResult =
                  apia.findObjects(org.fcrepo.server.utilities.TypeUtility.convertStringtoAOS(OBJECT_RESULT_FIELDS),
                                   MAX_FIND_RESULTS,
                                   genFieldSearchQuery);
          FieldSearchResult fsr =
                  TypeUtility
                          .convertGenFieldSearchResultToFieldSearchResult(searchResult);
          for (ObjectFields fields : fsr.objectFieldsList()) {
              stash.add(fields.getPid());
          }
          token = fsr.getToken();
      }
docs: We haven't tried searching yet. Do so, and set the stash and token from
  the results.