use of io.zulia.client.result.AssociatedResult in project zuliasearch by zuliaio.
the class ZuliaCmdUtil method fileExists.
private static boolean fileExists(ZuliaWorkPool zuliaWorkPool, String id, String fileName, String indexName) throws Exception {
Fetch fetchAssociated = new FetchAllAssociated(id, indexName).setAssociatedFetchType(META);
FetchResult fetch = zuliaWorkPool.fetch(fetchAssociated);
if (fetch.getAssociatedDocumentCount() > 0) {
for (AssociatedResult assDoc : fetch.getAssociatedDocuments()) {
if (assDoc.getFilename().equals(fileName)) {
return true;
}
}
}
return false;
}
Aggregations