use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class LuceneQueryErrorTest method init.
@Before
public void init() {
InputStream stream = ClassLoader.getSystemResourceAsStream("testLuceneIndex.sql");
db.command(new OCommandScript("sql", getScriptFromStream(stream))).execute();
db.command(new OCommandSQL("create index Song.title on Song (title) FULLTEXT ENGINE LUCENE")).execute();
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class LuceneReuseTest method shouldUseTheRightIndex.
@Test
public void shouldUseTheRightIndex() {
OSchemaProxy schema = db.getMetadata().getSchema();
OClass cls = schema.createClass("Reuse");
cls.createProperty("name", OType.STRING);
cls.createProperty("date", OType.DATETIME);
cls.createProperty("surname", OType.STRING);
cls.createProperty("age", OType.LONG);
db.command(new OCommandSQL("create index Reuse.composite on Reuse (name,surname,date,age) UNIQUE")).execute();
db.command(new OCommandSQL("create index Reuse.surname on Reuse (surname) FULLTEXT ENGINE LUCENE")).execute();
for (int i = 0; i < 10; i++) {
db.save(new ODocument("Reuse").field("name", "John").field("date", new Date()).field("surname", "Reese").field("age", i));
}
Collection<ODocument> results = db.command(new OCommandSQL("SELECT FROM Reuse WHERE name='John' and surname LUCENE 'Reese'")).execute();
Assert.assertEquals(10, results.size());
results = db.command(new OCommandSQL("SELECT FROM Reuse WHERE surname LUCENE 'Reese' and name='John'")).execute();
Assert.assertEquals(10, results.size());
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class LuceneSingleFieldEmbeddedTest method init.
@Before
public void init() {
InputStream stream = ClassLoader.getSystemResourceAsStream("testLuceneIndex.sql");
db.command(new OCommandScript("sql", getScriptFromStream(stream))).execute();
db.command(new OCommandSQL("create index Song.title on Song (title) FULLTEXT ENGINE LUCENE")).execute();
db.command(new OCommandSQL("create index Song.author on Song (author) FULLTEXT ENGINE LUCENE")).execute();
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class LuceneSkipLimitTest method init.
@Before
public void init() {
InputStream stream = ClassLoader.getSystemResourceAsStream("testLuceneIndex.sql");
db.command(new OCommandScript("sql", getScriptFromStream(stream))).execute();
db.command(new OCommandSQL("create index Song.title on Song (title) FULLTEXT ENGINE LUCENE")).execute();
db.command(new OCommandSQL("create index Song.author on Song (author) FULLTEXT ENGINE LUCENE")).execute();
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class LuceneInsertIntegrityRemoteTest method init.
@Before
public void init() {
OSchema schema = db.getMetadata().getSchema();
OClass oClass = schema.createClass("City");
oClass.createProperty("name", OType.STRING);
db.command(new OCommandSQL("create index City.name on City (name) FULLTEXT ENGINE LUCENE")).execute();
}
Aggregations