Grails: Best practice indexing domain class

(Christian von Wendt-Jensen) #1


What is the best way to index all fields of a Grails domain class?

The naive way is to copy the domain class field by field, but it would
be nice if you could just extract the properties of the document and
store them directly - kind of like:

class DocumentService {
def store(Document doc) {
def result = myClient.index {
index "csj"
type "doc"
id "$"
source {
complex {
}"Doc stored: $result")




Christian von Wendt-Jensen

(system) #2