Hello,
I have a problem when using OrientDB with Lucene Spatial.
I have downloaded orientdb-community-1.7.9
and orientdb-lucene-1.7.9-SNAPSHOT-dist.jar. I
put orientdb-lucene-1.7.9-SNAPSHOT-dist.jar in the plugin directory and
start the server with server.bat.
Here is the start log from the console
2014-10-17 09:01:19:356 INFO Loading configuration from: C:/Apps/orientdb-
community-1.7.9/config/orientdb-server-config.xml... [
OServerConfigurationLoaderXml]
2014-10-17 09:01:19:606 INFO OrientDB Server v1.7.9 (build UNKNOWN@r${
buildNumber}; 2014-09-22 14:46:19+0200) is starting up... [OServer]
2014-10-17 09:01:19:606 INFO Databases directory: C:\Apps\orientdb-community
-1.7.9\databases [OServer]
2014-10-17 09:01:19:646 INFO Listening binary connections on 0.0.0.0:2424
(protocol
v.21, socket=default) [OServerNetworkListener]
2014-10-17 09:01:19:646 INFO Listening http connections on 0.0.0.0:2480
(protocol
v.10, socket=default) [OServerNetworkListener]
2014-10-17 09:01:19:656 INFO Installing dynamic plugin
'orientdb-lucene-1.7.9-SNAPSHOT-dist.jar'... [OServerPluginManager]
2014-10-17 09:01:19:756 INFO Lucene index plugin installed and active.
Lucene version: LUCENE_47 [OLuceneIndexPlugin]
2014-10-17 09:01:19:756 INFO Installing dynamic plugin 'studio-1.7.8.zip'...
[OServerPluginManager]
2014-10-17 09:01:19:766 INFO Installing GREMLIN language v.2.5.0 - graph.
pool.max=50 [OGraphServerHandler]
2014-10-17 09:01:19:776 INFO Installing Script interpreter. WARN:
authenticatedclients can execute any kind of code into the server by using
the following allowed languages: [sql] [OServerSideScriptInterpreter]
2014-10-17 09:01:19:776 INFO OrientDB Server v1.7.9 is active. [OServer]
I
On the other hand, I created a maven project in eclipse with these
depedencies
<dependencies>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-graphdb</artifactId>
<version>1.7.9</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-lucene</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
Based on the example found here:
https://github.com/orientechnologies/orientdb-lucene/wiki/Spatial-Index, I
tried to add a new class and a spatial index.
public static void main(String[] args) {
ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx(
"remote:localhost/GratefulDeadConcerts").open("admin", "admin");
OSchema schema = databaseDocumentTx.getMetadata().getSchema();
if (schema.existsClass("Place")) {
schema.dropClass("Place");
}
OClass oClass = schema.createClass("Place");
oClass.createProperty("latitude", OType.DOUBLE);
oClass.createProperty("longitude", OType.DOUBLE);
oClass.createProperty("name", OType.STRING);
oClass.createIndex("Place.latitude_longitude", "SPATIAL", null, null
, "LUCENE", new String[] { "latitude", "longitude" });
}
But an exception is raised and the index is not create
Exception in thread "main" com.orientechnologies.orient.enterprise.channel.
binary.OResponseProcessingException: Exception during response processing.
at com.orientechnologies.orient.enterprise.channel.binary.
OChannelBinaryAsynchClient.throwSerializedException(
OChannelBinaryAsynchClient.java:408)
at com.orientechnologies.orient.enterprise.channel.binary.
OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:373)
at com.orientechnologies.orient.enterprise.channel.binary.
OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:265
)
at com.orientechnologies.orient.enterprise.channel.binary.
OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:160
)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(
OStorageRemote.java:1843)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(
OStorageRemote.java:944)
at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(
OStorageRemoteThread.java:446)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.
execute(OCommandRequestTextAbstract.java:59)
at com.orientechnologies.orient.core.index.OIndexManagerRemote.createIndex(
OIndexManagerRemote.java:58)
at com.orientechnologies.orient.core.index.OIndexManagerProxy.createIndex(
OIndexManagerProxy.java:75)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.createIndex
(OClassImpl.java:1407)
at com.marketip.orientdb.OrientDbMain.main(OrientDbMain.java:20)
Caused by: java.lang.IllegalArgumentException: No enum constant com.
orientechnologies.orient.core.metadata.schema.OType.DOUBLE ENGINE LUCENE
at java.lang.Enum.valueOf(Enum.java:238)
at com.orientechnologies.orient.core.metadata.schema.OType.valueOf(OType.
java:46)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateIndex.
parse(OCommandExecutorSQLCreateIndex.java:194)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateIndex.
parse(OCommandExecutorSQLCreateIndex.java:47)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(
OCommandExecutorSQLDelegate.java:52)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(
OCommandExecutorSQLDelegate.java:33)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(
OStorageEmbedded.java:81)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.
execute(OCommandRequestTextAbstract.java:59)
at com.orientechnologies.orient.server.network.protocol.binary.
ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1181)
at com.orientechnologies.orient.server.network.protocol.binary.
ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:340)
at com.orientechnologies.orient.server.network.protocol.binary.
OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:
169)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:45)
If I create the index using the web interface (studio), the index is
created correctly with this command : CREATE INDEX Place.lat_lon ON
Place(latitude,longitude) SPATIAL ENGINE LUCENE
Could you please help me?
I would like to create this index through the code and not only with the
studio.
Thank you.
Regards.
Philippe
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.