Specific Indexing
Thursday, March 20th, 2008Compass 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 ;)

My name is Shay Banon, the founder of