Archive for March 20th, 2008

Specific Indexing

Thursday, March 20th, 2008

Compass supports the ability to completely index external content (for example, a database mapped using an ORM) using very simple API:

1
2
ComapssGps gps = // ...
gps.index();

This indexing process is a parallel indexing process (by default) based on the number of sub indexes, and will go and fetch all the data mapped using the ORM tool and index it using Compass. The old content of the index (for all types) will be replaced by the new content.

Some Compass users have suggested a (very) valid feature request of being able to just index specific types. So now, this feature is available in trunk (todays nightly will have it). Here is what it looks like:

1
2
ComapssGps gps = // ...
gps.index(Person.class, Account.class);

This will only index the Person class and Account class data (in parallel if possible) and replace only their respective sub indexes. The rest of the index will remain the same.

Now, the only thing left is for the Grails Searchable Plugin to enable it so people will be able to this: Person.index() in groovy.

Finally I can go to bed ;)

Searchable Cascading Mapping

Thursday, March 20th, 2008

Compass 2.0.0 M3 version includes a really nice feature which is called searchable cascading. Compass support the ability to cascade operations when using the component and reference mappings. What Compass users wanted was the ability to defined cascade definitions for properties that do not necessarily have a component/reference mappings.

This feature is really handy when integrating with an ORM, which, because of a result of Account, the User object will be reindexed. More information can be found in the OSEM docs.