@Override public String getAlgorithm() { return delegate.getAlgorithm(); }
@Override public OIndex<?> getClassAutoShardingIndex(String className) { final Locale locale = getServerLocale(); className = className.toLowerCase(locale); // LOOK FOR INDEX for (OIndex<?> index : indexes.values()) { if (index != null && OAutoShardingIndexFactory.AUTOSHARDING_ALGORITHM.equals(index.getAlgorithm()) && index.getDefinition() != null && index.getDefinition().getClassName() != null && className .equals(index.getDefinition().getClassName().toLowerCase(locale))) return preProcessBeforeReturn(getDatabase(), index); } return null; }
@Override public OIndexCursor executeIndexQuery(OCommandContext iContext, OIndex<?> index, List<Object> keyParams, boolean ascSortOrder) { if (!index.getType().toLowerCase().contains("fulltext")) { return null; } if (index.getAlgorithm() == null || !index.getAlgorithm().toLowerCase().contains("lucene")) { return null; } Set<OIdentifiable> indexResult = (Set<OIdentifiable>) index .get(new OLuceneKeyAndMetadata(new OLuceneCompositeKey(keyParams).setContext(iContext), new ODocument())); if (indexResult == null) return new OIndexCursorSingleValue((OIdentifiable) indexResult, new OLuceneCompositeKey(keyParams)); return new OIndexCursorCollectionValue(indexResult, new OLuceneCompositeKey(keyParams)); }
@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])); }
@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])); }
final OIndex<?> idx = iterator.next(); if (idx != null) { if ("lucene".equalsIgnoreCase(idx.getAlgorithm())) { continue;
for (OIndex<?> index : indexes) { OIndexDefinition indexDef = index.getDefinition(); if ("lucene".equalsIgnoreCase(index.getAlgorithm())) { continue;
writer.writeAttribute(3, true, "name", index.getName()); writer.writeAttribute(3, true, "type", index.getType()); if (index.getAlgorithm() != null) writer.writeAttribute(3, true, "algorithm", index.getAlgorithm());