Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for @Fields annotation #13

Open
mcleanl opened this issue Mar 18, 2013 · 1 comment
Open

Support for @Fields annotation #13

mcleanl opened this issue Mar 18, 2013 · 1 comment

Comments

@mcleanl
Copy link

mcleanl commented Mar 18, 2013

In previous projects I have used hibernate search annotations to add one attribute to multiple fields (for different purposes eg. sorting, searching, projections).

@fields({ @field(index = Index.TOKENIZED, store = Store.YES),
@field(name = "simple_search", index = Index.TOKENIZED) })
private String description

When I do that using the plugin it results in the following error

unexpected token: @ @ line 16, column 2

I see no example of the @fields annotation in the documentation. Is it possible?

@mcleanl
Copy link
Author

mcleanl commented Mar 18, 2013

l could not find a way to do it with annotations without error (grails 2.1.1) but the following works. List the same field (value) multiple times and specifying the name attribute on all but the default index entry (which is stored in this example for using as a projection)

static search = {
// fields
value (index: 'tokenized', name:'simple_search')
value (index: 'un_tokenized', store : 'yes')
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant