Java Code Examples for com.orientechnologies.orient.core.index.OIndex#getMetadata()

The following examples show how to use com.orientechnologies.orient.core.index.OIndex#getMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OIndexPrototyper.java    From wicket-orientdb with Apache License 2.0 5 votes vote down vote up
@Override
protected OIndex<?> createInstance(OIndex proxy) {
	OSchema schema = OrientDbWebSession.get().getDatabase().getMetadata().getSchema();
	OClass oClass = schema.getClass(proxy.getDefinition().getClassName());
	String name = proxy.getName();
	List<String> fields = proxy.getDefinition().getFields();
	String type = proxy.getType();
	if(name==null) name=oClass.getName()+"."+fields.get(0);
	ODocument metadata = proxy.getMetadata();
	String algorithm = proxy.getAlgorithm();
	values.keySet().retainAll(RW_ATTRS);
	return oClass.createIndex(name, type, null, metadata, algorithm, fields.toArray(new String[0]));
}
 
Example 2
Source File: LuceneIndexFieldExtension.java    From guice-persist-orient with MIT License 4 votes vote down vote up
private String getAnalyzer(final OIndex classIndex) {
    // analyzer is stored only in metadata and there is no way to get default analyzer.. just assume it
    final ODocument metadata = classIndex.getMetadata();
    final String analyzer = metadata != null ? metadata.<String>field(ANALYZER) : null;
    return MoreObjects.firstNonNull(analyzer, StandardAnalyzer.class.getName());
}
 
Example 3
Source File: LuceneIndexTypeExtension.java    From guice-persist-orient with MIT License 4 votes vote down vote up
private String getAnalyzer(final OIndex classIndex) {
    // analyzer is stored only in metadata and there is no way to get default analyzer.. just assume it
    final ODocument metadata = classIndex.getMetadata();
    final String analyzer = metadata != null ? metadata.<String>field(LuceneIndexFieldExtension.ANALYZER) : null;
    return MoreObjects.firstNonNull(analyzer, StandardAnalyzer.class.getName());
}