public static Mapping getMapping(String store, String key, KeyInformation.IndexRetriever informations) { KeyInformation ki = informations.get(store, key); Preconditions.checkArgument(ki!=null,"Could not find key information for: %s",key); return getMapping(ki); }
public static Mapping getMapping(KeyInformation information) { Object value = ParameterType.MAPPING.findParameter(information.getParameters(),null); if (value==null) return DEFAULT; else { Preconditions.checkArgument((value instanceof Mapping || value instanceof String),"Invalid mapping specified: %s",value); if (value instanceof String) { value = Mapping.valueOf(value.toString().toUpperCase()); } return (Mapping)value; } }
private Parameter getStringMapping() { if (indexFeatures.supportsStringMapping(Mapping.STRING)) return Mapping.STRING.asParameter(); else if (indexFeatures.supportsStringMapping(Mapping.TEXTSTRING)) return Mapping.TEXTSTRING.asParameter(); throw new AssertionError("String mapping not supported"); }
private Parameter getStringMapping() { if (indexFeatures.supportsStringMapping(Mapping.STRING)) return Mapping.STRING.getParameter(); else if (indexFeatures.supportsStringMapping(Mapping.TEXTSTRING)) return Mapping.TEXTSTRING.getParameter(); throw new AssertionError("String mapping not supported"); }
private Parameter getTextMapping() { if (indexFeatures.supportsStringMapping(Mapping.TEXT)) return Mapping.TEXT.getParameter(); else if (indexFeatures.supportsStringMapping(Mapping.TEXTSTRING)) return Mapping.TEXTSTRING.getParameter(); throw new AssertionError("Text mapping not supported"); }
@Override public boolean supports(KeyInformation information) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType== Instant.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping==Mapping.DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping==Mapping.DEFAULT || mapping==Mapping.STRING || mapping==Mapping.TEXT || mapping==Mapping.TEXTSTRING) return true; } return false; }
public static Mapping getMapping(KeyInformation information) { Object value = ParameterType.MAPPING.findParameter(information.getParameters(),null); if (value==null) return DEFAULT; else { Preconditions.checkArgument((value instanceof Mapping || value instanceof String),"Invalid mapping specified: %s",value); if (value instanceof String) { value = Mapping.valueOf(value.toString().toUpperCase()); } return (Mapping)value; } }
private Parameter getTextMapping() { if (indexFeatures.supportsStringMapping(Mapping.TEXT)) return Mapping.TEXT.asParameter(); else if (indexFeatures.supportsStringMapping(Mapping.TEXTSTRING)) return Mapping.TEXTSTRING.asParameter(); throw new AssertionError("Text mapping not supported"); }
TitanGraphIndex mixed = mgmt.buildIndex("mixed", Vertex.class).addKey(name, Mapping.TEXTSTRING.getParameter()).buildMixedIndex(INDEX); mixed.getName(); finishSchema();
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = Mapping.getMapping(information); if (map==Mapping.DEFAULT) map = Mapping.TEXT; return map; }
public static Mapping getMapping(KeyInformation information) { Object value = ParameterType.MAPPING.findParameter(information.getParameters(),null); if (value==null) return DEFAULT; else { Preconditions.checkArgument((value instanceof Mapping || value instanceof String),"Invalid mapping specified: %s",value); if (value instanceof String) { value = Mapping.valueOf(value.toString().toUpperCase()); } return (Mapping)value; } }
TitanGraphIndex mixed = mgmt.buildIndex("mixed", Vertex.class).addKey(name, Mapping.TEXTSTRING.asParameter()).buildMixedIndex(INDEX); mixed.name(); finishSchema();
mgmt.buildIndex("blablub",Vertex.class).addKey(text, Mapping.TEXT.getParameter()).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {} mgmt.buildIndex("blablub",Vertex.class).addKey(text, Mapping.TEXT.getParameter()).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {}
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = Mapping.getMapping(information); if (map==Mapping.DEFAULT) map = Mapping.TEXT; return map; }
mgmt.buildIndex("blablub", Vertex.class).addKey(text, Mapping.TEXT.asParameter()).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) { mgmt.buildIndex("blablub", Vertex.class).addKey(text, Mapping.TEXT.asParameter()).buildCompositeIndex(); fail(); } catch (IllegalArgumentException e) {
@Override public boolean supports(KeyInformation information) { if(information.getCardinality() != Cardinality.SINGLE) { return false; } Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Instant.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping==Mapping.DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping==Mapping.DEFAULT || mapping==Mapping.TEXT || mapping==Mapping.STRING) return true; } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (mapping!=Mapping.DEFAULT && !AttributeUtil.isString(dataType)) return false; if (Number.class.isAssignableFrom(dataType)) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Geoshape.class) { return titanPredicate == Geo.WITHIN; } else if (AttributeUtil.isString(dataType)) { switch(mapping) { case DEFAULT: case TEXT: return titanPredicate == Text.CONTAINS || titanPredicate == Text.CONTAINS_PREFIX || titanPredicate == Text.CONTAINS_REGEX; case STRING: return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL || titanPredicate==Text.REGEX || titanPredicate==Text.PREFIX; case TEXTSTRING: return (titanPredicate instanceof Text) || titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } } else if (dataType == Date.class || dataType == Instant.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == Cmp.EQUAL || titanPredicate == Cmp.NOT_EQUAL; } else if (dataType == UUID.class) { return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (mapping!=Mapping.DEFAULT && !AttributeUtil.isString(dataType)) return false;
XContentBuilder mapping; Class<?> dataType = information.getDataType(); Mapping map = Mapping.getMapping(information); Preconditions.checkArgument(map==Mapping.DEFAULT || AttributeUtil.isString(dataType), "Specified illegal mapping [%s] for data type [%s]",map,dataType);
public static Mapping getMapping(String store, String key, KeyInformation.IndexRetriever informations) { KeyInformation ki = informations.get(store, key); Preconditions.checkArgument(ki!=null,"Could not find key information for: %s",key); return getMapping(ki); }