I am trying to search an index using the Java API, but only retrieve certain
fields from it. I think I have encountered a situation where if one tries to
specify any fields, using SearchRequestBuilder.addFields(), the source
always comes back empty. Here is a gist :
Thats the behavior (both in Java API and REST API), once you specify a field, then _source is not returned, and you have access to only those fields.
On Wednesday, April 6, 2011 at 3:45 PM, Giles Velarde wrote:
Hi,
I am trying to search an index using the Java API, but only retrieve certain fields from it. I think I have encountered a situation where if one tries to specify any fields, using SearchRequestBuilder.addFields(), the source always comes back empty. Here is a gist :
Thats the behavior (both in Java API and REST API), once you specify a
field, then _source is not returned, and you have access to only those
fields.
On Wednesday, April 6, 2011 at 3:45 PM, Giles Velarde wrote:
Hi,
I am trying to search an index using the Java API, but only retrieve
certain fields from it. I think I have encountered a situation where if one
tries to specify any fields, using SearchRequestBuilder.addFields(), the
source always comes back empty. Here is a gist :
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.