Search in sources :

Example 1 with AssociatedResult

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;
}
Also used : Fetch(io.zulia.client.command.Fetch) FetchResult(io.zulia.client.result.FetchResult) FetchAllAssociated(io.zulia.client.command.FetchAllAssociated) AssociatedResult(io.zulia.client.result.AssociatedResult)

Aggregations

Fetch (io.zulia.client.command.Fetch)1 FetchAllAssociated (io.zulia.client.command.FetchAllAssociated)1 AssociatedResult (io.zulia.client.result.AssociatedResult)1 FetchResult (io.zulia.client.result.FetchResult)1