From Compass to ElasticSearch


(Barak Yaish) #1

(I hope this post didn't sent twice..)

Hello,

I would like to migrate an app I wrote using Compass to work with
ElasticSearch (the Java API).

I did some searches and experiments, but failed to find the answers,
so can you point me to relevant docs to examples?

My questions are as follow:

  1. How do I index complex object (object that contain other objects )
    using the Java API? There are few words on that in the REST API, but
    when I tried to work something with the Java API I got exceptions...

  2. How can I declare what object properties are searchable and what
    are not? It it very easy in Compass with the annotations, didn't found
    the relative config in the Java API..

  3. Is the Java API allow bulk inserts (transactional)?

Thanks for any help!


(Shay Banon) #2

On Tuesday, January 11, 2011 at 5:18 PM, barak wrote:

(I hope this post didn't sent twice..)

Hello,

I would like to migrate an app I wrote using Compass to work with
ElasticSearch (the Java API).

I did some searches and experiments, but failed to find the answers,
so can you point me to relevant docs to examples?

My questions are as follow:

  1. How do I index complex object (object that contain other objects )
    using the Java API? There are few words on that in the REST API, but
    when I tried to work something with the Java API I got exceptions...

Just take that object and convert it to json. Jackson is great at doing that.

  1. How can I declare what object properties are searchable and what
    are not? It it very easy in Compass with the annotations, didn't found
    the relative config in the Java API..

There is the put mapping API. You can find it under client.admin().indices().preparePutMapping. You need to create a json based mapping definition.

  1. Is the Java API allow bulk inserts (transactional)?

No transaction support on ES, just atomicity per document. There is a bulk API, but its not transactional. In upcoming 0.15 (master) there is support for versioning (optimistic concurrency control in DB lang).

Thanks for any help!


(Alois Cochard) #3

Hello,

I'm actually implementing an OSEM for ElasticSearch, It's in early
phase, but you will be able to use it like you used Compass before
(annotation based).

I created annotation almost like in compass (even copied some of them
as is) to define indexing configuration and you will be able to use
JAXB annotation for serialization specific configuration (used by
jackson).

Cheers,

Alois Cochard

On Jan 11, 4:18 pm, barak barak.ya...@gmail.com wrote:

(I hope this post didn't sent twice..)

Hello,

I would like to migrate an app I wrote using Compass to work with
ElasticSearch (the Java API).

I did some searches and experiments, but failed to find the answers,
so can you point me to relevant docs to examples?

My questions are as follow:

  1. How do I index complex object (object that contain other objects )
    using the Java API? There are few words on that in the REST API, but
    when I tried to work something with the Java API I got exceptions...

  2. How can I declare what object properties are searchable and what
    are not? It it very easy in Compass with the annotations, didn't found
    the relative config in the Java API..

  3. Is the Java API allow bulk inserts (transactional)?

Thanks for any help!


(Barak Yaish) #4

This is sounds really nice, can you share your work?

Thanks.

On Jan 13, 4:36 pm, Alois Cochard alois.coch...@gmail.com wrote:

Hello,

I'm actually implementing an OSEM for ElasticSearch, It's in early
phase, but you will be able to use it like you used Compass before
(annotation based).

I created annotation almost like in compass (even copied some of them
as is) to define indexing configuration and you will be able to use
JAXB annotation for serialization specific configuration (used by
jackson).

Cheers,

Alois Cochard

On Jan 11, 4:18 pm, barak barak.ya...@gmail.com wrote:

(I hope this post didn't sent twice..)

Hello,

I would like to migrate an app I wrote using Compass to work with
ElasticSearch (the Java API).

I did some searches and experiments, but failed to find the answers,
so can you point me to relevant docs to examples?

My questions are as follow:

  1. How do I index complex object (object that contain other objects )
    using the Java API? There are few words on that in the REST API, but
    when I tried to work something with the Java API I got exceptions...
  1. How can I declare what object properties are searchable and what
    are not? It it very easy in Compass with the annotations, didn't found
    the relative config in the Java API..
  1. Is the Java API allow bulk inserts (transactional)?

Thanks for any help!


(Mauricio Alarcon) #5

Wow.. Alois I've just read your message, I've been peeking around the
compass and elastic search thinking to implement the OSEM as well, we
might be able to work together on this if you want to.

What do you think?

On Jan 13, 9:36 am, Alois Cochard alois.coch...@gmail.com wrote:

Hello,

I'm actually implementing anOSEMfor ElasticSearch, It's in early
phase, but you will be able to use it like you used Compass before
(annotation based).

I created annotation almost like in compass (even copied some of them
as is) to define indexing configuration and you will be able to use
JAXB annotation for serialization specific configuration (used by
jackson).

Cheers,

Alois Cochard

On Jan 11, 4:18 pm, barak barak.ya...@gmail.com wrote:

(I hope this post didn't sent twice..)

Hello,

I would like to migrate an app I wrote using Compass to work with
ElasticSearch (the Java API).

I did some searches and experiments, but failed to find the answers,
so can you point me to relevant docs to examples?

My questions are as follow:

  1. How do I index complex object (object that contain other objects )
    using the Java API? There are few words on that in the REST API, but
    when I tried to work something with the Java API I got exceptions...
  1. How can I declare what object properties are searchable and what
    are not? It it very easy in Compass with the annotations, didn't found
    the relative config in the Java API..
  1. Is the Java API allow bulk inserts (transactional)?

Thanks for any help!


(Alois Cochard) #6

I'll open-source it as soon as possible,

I already had a chat with kimchy to be sure to start in the good direction.
I'm doing it a job and just want to finish the basis before sharing, but unfortunately I wasn't able to work on it last week.

I hope to do it before end of the month, I'll keep in touch guys !!

Would be really happy to have some help on this :slight_smile:

A+

Alois Cochard


(Mauricio Alarcon) #7

Alois,

I'm eager to start working on that. Looking forward to hearing from
you. Let me know if you want me to start checking on something.. I
guess we can discuss it via PM

I'm still on the reading code phase but ready to start hacking the
code. Hopefully we can do a pull request soon

Mauricio

On Feb 2, 2:22 am, Alois Cochard alois.coch...@gmail.com wrote:

I'll open-source it as soon as possible,

I already had a chat with kimchy to be sure to start in the good direction.
I'm doing it a job and just want to finish the basis before sharing, but
unfortunately I wasn't able to work on it last week.

I hope to do it before end of the month, I'll keep in touch guys !!

Would be really happy to have some help on this :slight_smile:

A+

Alois Cochard

View this message in context:http://elasticsearch-users.115913.n3.nabble.com/From-Compass-to-Elast...
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(Alois Cochard) #8

I've finished a working POC, took some times because I did it on my free time...

Gonna fork ES and add new code before this week-end.

I let you know when code is ready !

See you guys,

Alois Cochard


http://www.twitter.com/aloiscochard


(Alois Cochard) #9

More info here: http://groups.google.com/a/elasticsearch.com/group/users/browse_thread/thread/0bbef0c8f29aa33b#

On Feb 3, 5:41 pm, maverick mauricio.alar...@gmail.com wrote:

Alois,

I'm eager to start working on that. Looking forward to hearing from
you. Let me know if you want me to start checking on something.. I
guess we can discuss it via PM

I'm still on the reading code phase but ready to start hacking the
code. Hopefully we can do a pull request soon

Mauricio

On Feb 2, 2:22 am, Alois Cochard alois.coch...@gmail.com wrote:

I'll open-source it as soon as possible,

I already had a chat with kimchy to be sure to start in the good direction.
I'm doing it a job and just want to finish the basis before sharing, but
unfortunately I wasn't able to work on it last week.

I hope to do it before end of the month, I'll keep in touch guys !!

Would be really happy to have some help on this :slight_smile:

A+

Alois Cochard

View this message in context:http://elasticsearch-users.115913.n3.nabble.com/From-Compass-to-Elast...
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #10