mstein / elasticsearch-grails-plugin

ElasticSearch grails plugin
Based on Graeme Rocher initial stub. Note that it is still in early stage.
Other
62 stars 164 forks source link

Problem running example: Property Tweet.tags is not mapped as [component], but broken search hit found. #40

Open winkler1 opened 12 years ago

winkler1 commented 12 years ago

Hi, I'm following the example from http://smaldini.github.com/elasticsearch-grails-plugin/docs/guide/8.%20Example.html.

Bootstrap data:

    def u = new User(firstname:'Jeff',lastname:'Winkler', password:'foo').save()
    def tgroovy = new Tag(name:'Groovy').save()
    def tgrails = new Tag(name:'Grails').save()
    new Tweet ( user:u, tags:[tgroovy,tgrails], message:'Grails where queries look fantastic').save()

Hitting http://localhost:8080/search/elasticSearch/searchAll?query=grails matches both the tweet and the tag. The tag is fine, but unmarshalling the tweet fails with:

Property Tweet.tags is not mapped as [component], but broken search hit found.

The data map in DomainClassUnmarshaller.unmarshallProperty() is {id=1, name=Groovy, class=search.Tag}.

The example page does not have tags as component:true. Doing so results in:

MergeMappingException: Merge failed with failures {[mapper [tags.id] has different index values, mapper [tags.name] has different term_vector values, mapper [tags.class] has different index values, mapper [tags.class] has different index_analyzer, mapper [tags.class] has different search_analyzer]}

If it'll help, I'll check the project into github?