« Return to Thread: [ANN] Searchable Plugin 0.4 ships

Re: [ANN] Searchable Plugin 0.4 ships

by Maurice Nicholson-2 :: Rate this Message:

Reply to Author | View in Thread

if you do get errors with the latest version please shout :-)

yeah this is on the roadmap (in my head); the closure would be given an instance of the domain class so you could refer to the instance with it, eg,

    name: "bugId", value: { -> "${it.project.shortName}-${it.number}" }

Compass has the concept of "dynamic-meta-data" for this but with that you basically define the expression as a string, which can get cumbersome for large expressions, because when configuring the mapping with native compass you're either in XML-land or annotation -land, neither of which are actually code :-)

Regarding that trying to marshall null id bug you found, I could reproduce it easily with a Grails app, but then when I tried reproducing it in a paired down Java+Hibernate+Compass Test case, well of course I got a different problem! I think there are many more moving parts in the Grails app that I'm not yet aware of, so I need to do more investigation, but it's now the top priority for me.


On 17/03/2008, Barzilai Spinak <barcho@...> wrote:
Computed constants.
Hi Maurice, congratulations for the final release!
I still had lots of errors from the SVN version of a couple of days ago,
but I'm gonna try this one.
I was reading the updated documentation and I found the section about
constants.
I understand that you can index "custom" mappings to a domain instance,
that's very useful.
What I was wondering is whether those constant mappings could be
computed. That is, computed out of other properties (for example a
concatenation of two properties, or maybe a substring of one of them
plus the temperature in Madagascar at that time... some crazy example :-))
Maybe it could accept a clousre, like:
    constant  name: "myComputed" ,   value: {
"bla"+tempMadagascar+(someProp*3) }

I guess those constants are indexed when the object is saved/updated, so
all the values are already there.

BarZ



Maurice Nicholson wrote:
> Searchable Plugin 0.4 is finally here!
>
> I guess most of you have been using the 0.4-SNAPSHOT for a while, so
> here's what's happened recently:
>
> * Upgraded to Compass 1.2.1 which includes Lucene 2.2
> * Highlighting:
> http://grails.org/Searchable+Plugin+-+Searching#SearchablePlugin-Searching-Highlighting
> * Term Frequencies:
> http://grails.org/Searchable+Plugin+-+Searching#SearchablePlugin-Searching-termFreqs
> * The start of a mapping DSL:
> http://grails.org/Searchable+Plugin+-+Mapping#SearchablePlugin-Mapping-MappingDSL
> * Better default mapping of embedded domain classes:
> http://grails.org/Searchable+Plugin+-+Mapping#SearchablePlugin-Mapping-Defaultmappingrules
>
> Cheers,
> Maurice
>



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



 « Return to Thread: [ANN] Searchable Plugin 0.4 ships