use of io.hops.hopsworks.common.elastic.FeaturestoreDocType in project hopsworks by logicalclocks.
the class ElasticFeaturestoreBuilder method build.
public ElasticFeaturestoreDTO build(ElasticFeaturestoreRequest req, Integer projectId) throws ElasticException, ServiceException, GenericException {
checkRequest(req);
Project project = projectFacade.find(projectId);
Map<FeaturestoreDocType, Set<Integer>> searchProjects = datasetAccessCtrl.featurestoreSearchContext(project, req.getDocType());
Map<FeaturestoreDocType, SearchResponse> response = elasticCtrl.featurestoreSearch(req.getTerm(), searchProjects, req.getFrom(), req.getSize());
DatasetAccessController.DatasetAccessCtrl localProjectOnly = (datasetDetails, projectsCollector) -> projectsCollector.addAccessProject(project);
ElasticFeaturestoreDTO result = parseResult(response, localProjectOnly);
result.setFeaturegroupsFrom(req.getFrom());
result.setTrainingdatasetsFrom(req.getFrom());
result.setFeaturesFrom(req.getFrom());
return result;
}
Aggregations