Last updated by maurice
4 years ago
index
Summary
Indexes searchable class instances (adds them to the search index)Syntax
domainObject.index()
DomainClass.index() DomainClass.index(DomainClass instances...) DomainClass.index(Serializable ids...)
searchableService.index() searchableService.index(Map options) searchableService.index(DomainClass instances...) searchableService.index(Serializable ids..) searchableService.index(Map options, Serializable ids...)
Description
When called as a domain class instance method, indexes the instance.When called as a domain class static method with no arguments, indexes all instances for that class (or hierarchy).When called as aSearchableService method with no arguments, indexes all searchable class instances.In other invocations, indexes the searchable class instances you provide or identify.Parameters
- @instances@ - One or more searchable class instances
- @ids@ - One or more searchable class instance ids
- @options@ - A
Mapof options
options
- @class@ - a searchable class; use this option with the
SearchableServicemethod andidsparameter or as an alternative to the domain-class method
Returns
No meaningful valueExamples
// Index a Post instance post.index()
// Add some Menus to the index Menu.index(m1, m2)
// Add all Countries to the index Country.index()
// Index everything searchableService.index()
// Index the identified Book searchableService.index(class: Book, 1l)
// Index the given Tool searchableService.index(tool)