fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java
public final List<Form> searchAndConvertHitsToFormWithNoFields(
			QueryBuilder qbParam,
			String indexParam,
			int offsetParam,
			int limitParam,
			Long ... formTypesParam
	) {
		SearchHits searchHits = this.searchWithHits(
				qbParam,
				indexParam,
				false,
				offsetParam,
				limitParam,
				formTypesParam);

		List<Form> returnVal = null;

		long totalHits;
		if (searchHits != null && (totalHits = searchHits.getTotalHits()) > 0) {
			returnVal = new ArrayList();

			if((searchHits.getHits().length != totalHits) &&
					(searchHits.getHits().length != limitParam)) {
				throw new FluidElasticSearchException(
						"The Hits and fetch count has mismatch. Total hits is '"+
								totalHits+"' while hits is '"+
								searchHits.getHits().length+"'.");
			}

			long iterationMax = totalHits;
			if(limitParam > 0 && totalHits > limitParam) {
				iterationMax = limitParam;
			}

			//Iterate...
			for(int index = 0;index < iterationMax;index++) {
				SearchHit searchHit = searchHits.getAt(index);

				String source;
				if((source = searchHit.getSourceAsString()) == null) {
					continue;
				}

				this.printInfoOnSourceFromES(searchHit);

				Form formFromSource = new Form();

				formFromSource.populateFromElasticSearchJson(
						new JSONObject(source),
						null);

				returnVal.add(formFromSource);
			}
		}

		return returnVal;
	}
public final List<Form> searchAndConvertHitsToFormWithNoFields(
			QueryBuilder qbParam,
			String indexParam,
			int offsetParam,
			int limitParam,
			Long ... formTypesParam
	) {
		SearchHits searchHits = this.searchWithHits(
				qbParam,
				indexParam,
				false,
				offsetParam,
				limitParam,
				formTypesParam);

		List<Form> returnVal = null;

		long totalHits;
		if (searchHits != null && (totalHits = searchHits.getTotalHits()) > 0) {
			returnVal = new ArrayList();

			if((searchHits.getHits().length != totalHits) &&
					(searchHits.getHits().length != limitParam)) {
				throw new FluidElasticSearchException(
						"The Hits and fetch count has mismatch. Total hits is '"+
								totalHits+"' while hits is '"+
								searchHits.getHits().length+"'.");
			}

			long iterationMax = totalHits;
			if(limitParam > 0 && totalHits > limitParam) {
				iterationMax = limitParam;
			}

			//Iterate...
			for(int index = 0;index < iterationMax;index++) {
				SearchHit searchHit = searchHits.getAt(index);

				String source;
				if((source = searchHit.getSourceAsString()) == null) {
					continue;
				}

				this.printInfoOnSourceFromES(searchHit);

				Form formFromSource = new Form();

				formFromSource.populateFromElasticSearchJson(
						new JSONObject(source),
						null);

				returnVal.add(formFromSource);
			}
		}

		return returnVal;
	}
Performs a search against the Elasticsearch instance with the {@code qbParam}.

@param qbParam The @{code QueryBuilder} to search with.
@param indexParam The Elasticsearch Index to use {@code (document, folder or table_field)}.
@param offsetParam The offset for the results to return.
@param limitParam The max number of results to return.
@param formTypesParam The Id's for the Form Definitions to be returned.

@return The {@code SearchHits} as Fluid {@code Form}.

@see Form
@see SearchHits