public Field getMapping() { return Field.parseField(client.getMapping(resourceR.mapping())); }
public boolean indexExists(boolean read) { Resource res = (read ? resourceR : resourceW); // cheap hit boolean exists = client.exists(res.indexAndType()); // could be a _all or a pattern which is valid for read // try again by asking the mapping - could be expensive if (!exists && read) { try { // make sure the mapping is null since the index might exist but the type might be missing exists = !client.getMapping(res.mapping()).isEmpty(); } catch (EsHadoopInvalidRequest ex) { exists = false; } } return exists; }
public void putMapping(BytesArray mapping) { client.putMapping(resourceW.index(), resourceW.mapping(), mapping.bytes()); }
public MappingSet getMappings() { return FieldParser.parseMapping(client.getMapping(resources.getResourceRead().mapping())); }
public MappingSet getMappings() { return FieldParser.parseMapping(client.getMapping(resources.getResourceRead().mapping())); }
public MappingSet getMappings() { return FieldParser.parseMapping(client.getMapping(resources.getResourceRead().mapping())); }
public void putMapping(BytesArray mapping) { client.putMapping(resources.getResourceWrite().index(), resources.getResourceWrite().mapping(), mapping.bytes()); }
public void putMapping(BytesArray mapping) { client.putMapping(resources.getResourceWrite().index(), resources.getResourceWrite().mapping(), mapping.bytes()); }
public void putMapping(BytesArray mapping) { client.putMapping(resources.getResourceWrite().index(), resources.getResourceWrite().mapping(), mapping.bytes()); }
public boolean indexExists(boolean read) { Resource res = (read ? resources.getResourceRead() : resources.getResourceWrite()); // cheap hit boolean exists = client.indexExists(res.index()); if (exists && StringUtils.hasText(res.type())) { exists = client.typeExists(res.index(), res.type()); } // could be a _all or a pattern which is valid for read // try again by asking the mapping - could be expensive if (!exists && read) { try { // make sure the mapping is null since the index might exist but the type might be missing exists = !client.getMapping(res.mapping()).isEmpty(); } catch (EsHadoopInvalidRequest ex) { exists = false; } } return exists; }
public boolean indexExists(boolean read) { Resource res = (read ? resources.getResourceRead() : resources.getResourceWrite()); // cheap hit boolean exists = client.indexExists(res.index()); if (exists && StringUtils.hasText(res.type())) { exists = client.typeExists(res.index(), res.type()); } // could be a _all or a pattern which is valid for read // try again by asking the mapping - could be expensive if (!exists && read) { try { // make sure the mapping is null since the index might exist but the type might be missing exists = !client.getMapping(res.mapping()).isEmpty(); } catch (EsHadoopInvalidRequest ex) { exists = false; } } return exists; }
public boolean indexExists(boolean read) { Resource res = (read ? resources.getResourceRead() : resources.getResourceWrite()); // cheap hit boolean exists = client.indexExists(res.index()); if (exists && StringUtils.hasText(res.type())) { exists = client.typeExists(res.index(), res.type()); } // could be a _all or a pattern which is valid for read // try again by asking the mapping - could be expensive if (!exists && read) { try { // make sure the mapping is null since the index might exist but the type might be missing exists = !client.getMapping(res.mapping()).isEmpty(); } catch (EsHadoopInvalidRequest ex) { exists = false; } } return exists; }