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

Problem rendering Json format from search query in restfullcontroller #1

Open
rkimaoui opened this issue Jun 11, 2015 · 0 comments
Open

Comments

@rkimaoui
Copy link

Hello,

I can't render results from search query in json format.
Here is my code:

class Post {

    Integer id
    String title
    String type
    String content

    static constraints = {
    }
    static searchable = true
}


class PostController extends RestfulController {

static responseFormats = ['json', 'xml']

    PostController() {
        super(Post)
    }

def search () {
Map searchResults = Post.search("test")
render searchResults
}

//Other methods..
}

It renders an Array.
If i write render searchResults as JSON, it returns this {"total":6,"searchResults":{"empty":false}}

Thanks in advance for your help !
R

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