If you want only some fields, you can use that: https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java#L415-415
HTH -- David Pilato | Technical Advocate | Elasticsearch.com @dadoonet | @elasticsearchfr Le 30 janvier 2014 at 18:08:50, Martin Pape (pape.mar...@gmail.com) a écrit: Hi and thanks for the reply. >I guess you did not ask for specific fields in your query so only _source is >returned by default. No, I was specifying the fields to return. "type" was one of them. >You can get the full Json document back Yes, this is where I saw what both values were in the search result. I just wanted to stay "inside the API" and not start to interpret the json of the search result myself. But if it has to be... BR - Martin On Thursday, January 30, 2014 6:01:38 PM UTC+1, David Pilato wrote: I guess you did not ask for specific fields in your query so only _source is returned by default. You can get the full Json document back. Have a look at https://github.com/elasticsearchfr/hands-on/blob/answers/src/test/java/org/elasticsearchfr/handson/ex2/SearchTest.java#L392 -- David Pilato | Technical Advocate | Elasticsearch.com @dadoonet | @elasticsearchfr Le 30 janvier 2014 at 11:27:18, Martin Pape (pape....@gmail.com) a écrit: Hi, the json (logged with SearchResponse.toString()) of my search result looks like this: ... "title": "abc, cdf Systemfunktionen", "type": [ "abc", "cdf" ] ... so field: type is an array of 2 values. Then in SearchHitField.getValues().size() I get only 1. How to get both values "abc" and "cdf" from the SearchHitField so SearchHitField.getValues().size() == 2 ? Please advice and many thanks in advance! Martin -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/40bdfdac-2583-46cb-ac08-c792afd83d33%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9a1ca261-0527-4c86-861d-52a8258c3d9c%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.52ea8d33.2ca88611.45fa%40MacBook-Air-de-David.local. For more options, visit https://groups.google.com/groups/opt_out.