Using Ebean to map to ElasticSearch (without any other DB, insert, update, delete, query etc)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
pom.xml

README.md

example-elasticsearch-only

Using Ebean to map to ElasticSearch (without any other DB, insert, update, delete, query etc)

Annotate beans with @DocStore (and not @Entity)

@DocStore
public class Content extends BaseDomain {

  @DocSortable(store = true)
  String title;

  @DocEmbedded(doc = "id, name")
  @ManyToOne
  Author author;

  String subject;

  @DbJson
  Map<String,Object> content;

  /**
   * These are unmapped properties at the top level.
   */
  @UnmappedJson
  Map<String,Object> unmapped;

define properties (test-ebean.properties)

ebean.docstoreonly=true

ebean.docstore.url=http://127.0.0.1:9200
ebean.docstore.active=true
ebean.docstore.generateMapping=true
ebean.docstore.dropCreate=true

Do stuff, insert, update, delete query etc

    Author rob = new Author("rob");
    rob.setAddress(new Address("93 fow", "auckland"));

    rob.save();