I am unable to get fields using Elastic Search. I have following query for
searching and needs all documents along with all fields but my Search Hits
is returning empty fields in each Search Hits. Can anyone guide me where i
am wrong. "QueryBuilder qb =
QueryBuilders.queryString(searchSourceBuilder.toString());"
SearchRequestBuilder request = client.prepareSearch() .setIndices(index)
.setTypes(type) .setQuery(qb) .setFrom(0)
.setSearchType(SearchType.QUERY_AND_FETCH) .setSize(60) .setExplain(true);
On Saturday, June 15, 2013 1:46:40 PM UTC+5, Sardar Waqas Ahmed wrote:
I am unable to get fields using Elastic Search. I have following query
for searching and needs all documents along with all fields but my Search
Hits is returning empty fields in each Search Hits. Can anyone guide me
where i am wrong. "QueryBuilder qb =
QueryBuilders.queryString(searchSourceBuilder.toString());"
SearchRequestBuilder request = client.prepareSearch() .setIndices(index)
.setTypes(type) .setQuery(qb) .setFrom(0)
.setSearchType(SearchType.QUERY_AND_FETCH) .setSize(60) .setExplain(true);
By default, elasticsearch will not store fields, but does store the
document source. The data you want can be extracted from the source
document. This behavior assumes you are using the default. Proving your
mapping will give us more insights.
Also, please do not ask for help again five minutes later. The mailing list
is not a source for instantaneous answers, although occasionally it can be.
In addition, it is the weekend, so the number of readers is far lower.
On Saturday, June 15, 2013 1:46:40 PM UTC+5, Sardar Waqas Ahmed wrote:
I am unable to get fields using Elastic Search. I have following
query for searching and needs all documents along with all fields but my
Search Hits is returning empty fields in each Search Hits. Can anyone guide
me where i am wrong. "QueryBuilder qb = QueryBuilders.queryString(**
searchSourceBuilder.toString()**);" SearchRequestBuilder request =
client.prepareSearch() .setIndices(index) .setTypes(type) .setQuery(qb)
.setFrom(0) .setSearchType(SearchType.**QUERY_AND_FETCH) .setSize(60)
.setExplain(true);
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.