Searching using JAVA and REST APIs

Hi All,

Please, could you provide a simple search example integrating JAVA and REST APIs.
I´ve tried the below example but it failures.

String queryString = "{" +
""query" : { " +
" "term" : { " +
" "message" : "test" " +
"}}}";

SearchRequestBuilder srb = client.prepareSearch(indexName).
setSearchType(SearchType.QUERY_AND_FETCH).
setQuery(queryString);

Thanks,

Alex