Parent child for unique index on complex beans

Haven't experimented with ElasticSearch (only read about it).....

Use Neo4j as a store which by default utilizes Lucene to index nodes (and
relationships). One thing that has always troubled me is how to *unique *index
complex beans. Neo4j has nodes and the relationships between them. There
is a great SDN module (Spring) that allows domain beans to roll back and
forth into Neo4j nodes and parent/child relationships. This is great. I
can create a complex bean like Software with a name property (simple, just
a string) and an organisation property (complex pointing to another bean).
Software might have a name "core" and an organisation (via a Neo4j
relation under the covers) with a name "org.matthew". Unique indexes in
the SDN exposes Lucene indexes direct (iow, flat documents). So I can put
a unique index on but in my world Software isn't unique just
on it's name but rather a combination of name plus the name of the
organisation. It is a complex index reacting to changes to the "child".
For example, if organisation "org.matthew" becomes "org.young" then the
unique index on Software must be checked for duplicates. Or if the
organisation "org.matthew" is deleted the request can't be allowed since it
might kill the index on Software beans.

Each node in Neo4j has a unique id. Could I use the ElasticSearch
parent/child stuff to make "complex" *unique *indexes? How deep can the
parent/child path get?


Installed ES....

And played around with the examples from:

If I had read the blog better the first time around I would have noticed
the restriction on indexing books (children to authors). Namely that an
author (parent) has to be stated in the creation of the book index. Hum.

In my case with Software then I have to register Organisation first and
that "bean" has to have a "simple" index (iow. no parent/child) then I can
register Software with a parent mapping to Organisation. Breaks the case
when the Organisation reference in the Software can be null but works in
theory otherwise. Surprised that I could delete the author indexes!? And
even more surprised when I do GETs that I don't see the mapping information
in the response.

Weird that the mapping is required to create the book's index but then the
associated author index can be deleted. Maybe the parent-child mapping can
be made more restrictive?