gontard
gontard

Reputation: 29520

OrientDB : programmatically query a full text index

I have created an automatic full-text index on a vertex property.

OrientVertexType entryType = graph().createVertexType("Person");
entryType.createProperty("name", OType.STRING);
entryType.createIndex("Person.name", "FULLTEXT", new String[] { "name" });

Now i would like to programmatically query this full text index. For example to search all persons with a name starting with "Seb".

OIndex<?> nameIndex = graph().createVertexType("Person").getClassIndex("Person.name");
// nameIndex.query("%Seb%"); 

How can i do this ?

Upvotes: 0

Views: 186

Answers (1)

wolf4ood
wolf4ood

Reputation: 1949

You can use:

nameIndex.get("Seb");

Upvotes: 0

Related Questions