graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java
public Iterable<Vertex> getVertices(final String iKey, Object iValue) {
    makeActive();

    if (iKey.equals("@class"))
      return getVerticesOfClass(iValue.toString());

    int pos = iKey.indexOf('.');
    final String className = pos > -1 ? iKey.substring(0, pos) : OrientVertexType.CLASS_NAME;
    final String key = pos > -1 ? iKey.substring(pos + 1) : iKey;

    OClass clazz = getDatabase().getMetadata().getImmutableSchemaSnapshot().getClass(className);

    if (clazz == null) {
      throw new IllegalArgumentException("OClass not found in the schema: " + className);
    }
    OIndex<?> idx = null;
    final Collection<? extends OIndex<?>> indexes = clazz.getIndexes();
    for (OIndex<?> index : indexes) {
      OIndexDefinition indexDef = index.getDefinition();
      if ("lucene".equalsIgnoreCase(index.getAlgorithm())) {
        continue;
      }
      List<String> indexedFields = indexDef.getFields();
      if (indexedFields != null && indexedFields.size() > 0 && indexedFields.get(0).equals(key)) {
        idx = index;
        break;
      }
    }
    if (idx == null) {
      idx = getDatabase().getMetadata().getIndexManager().getIndex(iKey);
    }

    if (idx != null) {
      iValue = convertKey(idx, iValue);
      Object indexValue = idx.get(iValue);
      if (indexValue != null && !(indexValue instanceof Iterable<?>))
        indexValue = Arrays.asList(indexValue);

      return new OrientElementIterable<Vertex>(this, (Iterable<?>) indexValue);
    } else {
      // NO INDEX: EXECUTE A QUERY
      OrientGraphQuery query = (OrientGraphQuery) query();
      query.labels(clazz.getName());
      return query.has(key, iValue).vertices();
    }
  }
public Iterable<Vertex> getVertices(final String iKey, Object iValue) {
    makeActive();

    if (iKey.equals("@class"))
      return getVerticesOfClass(iValue.toString());

    int pos = iKey.indexOf('.');
    final String className = pos > -1 ? iKey.substring(0, pos) : OrientVertexType.CLASS_NAME;
    final String key = pos > -1 ? iKey.substring(pos + 1) : iKey;

    OClass clazz = getDatabase().getMetadata().getImmutableSchemaSnapshot().getClass(className);

    if (clazz == null) {
      throw new IllegalArgumentException("OClass not found in the schema: " + className);
    }
    OIndex<?> idx = null;
    final Collection<? extends OIndex<?>> indexes = clazz.getIndexes();
    for (OIndex<?> index : indexes) {
      OIndexDefinition indexDef = index.getDefinition();
      if ("lucene".equalsIgnoreCase(index.getAlgorithm())) {
        continue;
      }
      List<String> indexedFields = indexDef.getFields();
      if (indexedFields != null && indexedFields.size() > 0 && indexedFields.get(0).equals(key)) {
        idx = index;
        break;
      }
    }
    if (idx == null) {
      idx = getDatabase().getMetadata().getIndexManager().getIndex(iKey);
    }

    if (idx != null) {
      iValue = convertKey(idx, iValue);
      Object indexValue = idx.get(iValue);
      if (indexValue != null && !(indexValue instanceof Iterable<?>))
        indexValue = Arrays.asList(indexValue);

      return new OrientElementIterable<Vertex>(this, (Iterable<?>) indexValue);
    } else {
      // NO INDEX: EXECUTE A QUERY
      OrientGraphQuery query = (OrientGraphQuery) query();
      query.labels(clazz.getName());
      return query.has(key, iValue).vertices();
    }
  }
public Iterable < Vertex > getVertices ( final String iKey , Object iValue ) { makeActive ( ) ; if ( iKey . equals ( "@class" ) ) return getVerticesOfClass ( iValue . toString ( ) ) ; int pos = iKey . indexOf ( ' ' ) ; final String className = pos > - 1 ? iKey . substring ( 0 , pos ) : OrientVertexType . CLASS_NAME ; final String key = pos > - 1 ? iKey . substring ( pos + 1 ) : iKey ; OClass clazz = getDatabase ( ) . getMetadata ( ) . getImmutableSchemaSnapshot ( ) . getClass ( className ) ; if ( clazz == null ) { throw new IllegalArgumentException ( "OClass not found in the schema: " + className ) ; } OIndex < ? > idx = null ; final Collection < ? extends OIndex < ? > > indexes = clazz . getIndexes ( ) ; for ( OIndex < ? > index : indexes ) { OIndexDefinition indexDef = index . getDefinition ( ) ; if ( "lucene" . equalsIgnoreCase ( index . getAlgorithm ( ) ) ) { continue ; } List < String > indexedFields = indexDef . getFields ( ) ; if ( indexedFields != null && indexedFields . size ( ) > 0 && indexedFields . get ( 0 ) . equals ( key ) ) { idx = index ; break ; } } if ( idx == null ) { idx = getDatabase ( ) . getMetadata ( ) . getIndexManager ( ) . getIndex ( iKey ) ; } if ( idx != null ) { iValue = convertKey ( idx , iValue ) ; Object indexValue = idx . get ( iValue ) ; if ( indexValue != null && ! ( indexValue instanceof Iterable < ? > ) ) indexValue = Arrays . asList ( indexValue ) ; return new OrientElementIterable < Vertex > ( this , ( Iterable < ? > ) indexValue ) ; } else { // NO INDEX: EXECUTE A QUERY OrientGraphQuery query = ( OrientGraphQuery ) query ( ) ; query . labels ( clazz . getName ( ) ) ; return query . has ( key , iValue ) . vertices ( ) ; } }
Get all the Vertices in Graph filtering by field name and value. Example:<code>
Iterable<Vertex> resultset = getVertices("name", "Jay");
</code>

@param iKey   Field name
@param iValue Field value

@return Vertices as Iterable
Get all the Vertices in Graph filtering by field name and value . Example : <code > Iterable<Vertex > resultset = getVertices ( name Jay ) ; < / code >