Package com.orientechnologies.orient.core.index

Examples of com.orientechnologies.orient.core.index.OPropertyIndex


      linkedType = OType.getById(((Integer) document.field("linkedType")).byteValue());

    final OIndex underlyingIndex = getDatabase().getMetadata().getIndexManager().getIndex(getFullName());

    if (underlyingIndex != null)
      index = new OPropertyIndex(getDatabase(), owner, new String[] { name });
  }
View Full Code Here


   *          <li>FULLTEXT: Indexes single word for full text search</li>
   *          </ul>
   * @return
   */
  public OPropertyIndex createIndex(final INDEX_TYPE iType) {
    index = new OPropertyIndex(getDatabase(), owner, new String[] { name }, iType.toString(), type);
    return index;
  }
View Full Code Here

   *          <li>FULLTEXT: Indexes single word for full text search</li>
   *          </ul>
   * @return
   */
  public OPropertyIndex createIndexInternal(final String iType, final OProgressListener iProgressListener) {
    index = new OPropertyIndex(getDatabase(), owner, new String[] { name }, iType, type, iProgressListener);
    saveInternal();
    return index;
  }
View Full Code Here

  public OPropertyIndex setIndex(final OIndex iIndex) {
    getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter property %s index %s", getFullName(), iIndex.getIdentity());
    getDatabase().command(new OCommandSQL(cmd)).execute();

    index = new OPropertyIndex(getDatabase(), owner, new String[] { name });

    return index;
  }
View Full Code Here

    return index;
  }

  public OPropertyIndex setIndexInternal(final String iIndexName) {
    index = new OPropertyIndex(getDatabase(), owner, new String[] { name });
    return index;
  }
View Full Code Here

      linkedType = OType.getById(((Integer) document.field("linkedType")).byteValue());

    final OIndex underlyingIndex = getDatabase().getMetadata().getIndexManager().getIndex(getFullName());

    if (underlyingIndex != null)
      index = new OPropertyIndex(getDatabase(), owner, new String[] { name });
  }
View Full Code Here

    vDoc = database.load(vDoc.getIdentity());
    vDoc.field("nick", "JayM2");
    vDoc.field("nick", "JayM3");
    vDoc.save();

    OPropertyIndex index = database.getMetadata().getSchema().getClass("Profile").getProperty("nick").getIndex();

    Set<OIdentifiable> vOldName = index.getUnderlying().get("JayM1");
    Set<OIdentifiable> vIntermediateName = index.getUnderlying().get("JayM2");
    Set<OIdentifiable> vNewName = index.getUnderlying().get("JayM3");

    Assert.assertEquals(vOldName.size(), 0);
    Assert.assertEquals(vIntermediateName.size(), 0);
    Assert.assertEquals(vNewName.size(), 1);
View Full Code Here

    vDoc = database.newInstance();
    vDoc.setClassName("Profile");
    vDoc.field("nick", "Jack").field("name", "Jack").field("surname", "Bauer");
    vDoc.save();

    OPropertyIndex indexName = database.getMetadata().getSchema().getClass("Profile").getProperty("name").getIndex();

    // We must get 2 records for "nameA".
    Set<OIdentifiable> vName1 = indexName.getUnderlying().get("Jack");
    Assert.assertEquals(vName1.size(), 2);

    // Remove this last record.
    database.delete(vDoc);

    // We must get 1 record for "nameA".
    vName1 = indexName.getUnderlying().get("Jack");
    Assert.assertEquals(vName1.size(), 1);

    database.close();
  }
View Full Code Here

    final OClass mapPointClass = database.getMetadata().getSchema().createClass("MapPoint");
    mapPointClass.createProperty("x", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);
    mapPointClass.createProperty("y", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);

    final OPropertyIndex xIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("x").getIndex();
    Assert.assertNotNull(xIndex);

    final OPropertyIndex yIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("y").getIndex();
    Assert.assertNotNull(yIndex);

    database.close();
  }
View Full Code Here

  @Test(dependsOnMethods = "geoSchema")
  public void checkGeoIndexes() {
    database.open("admin", "admin");
    database.getMetadata().getIndexManager().load();

    final OPropertyIndex xIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("x").getIndex();
    Assert.assertNotNull(xIndex);

    final OPropertyIndex yIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("y").getIndex();
    Assert.assertNotNull(yIndex);

    database.close();
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.index.OPropertyIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.