use of io.vertigo.dynamo.domain.model.DtListState in project vertigo by KleeGroup.
the class AbstractESSearchServicesPlugin method loadList.
/**
* {@inheritDoc}
*/
@Override
public final <R extends DtObject> FacetedQueryResult<R, SearchQuery> loadList(final SearchIndexDefinition indexDefinition, final SearchQuery searchQuery, final DtListState listState) {
Assertion.checkNotNull(searchQuery);
// -----
final ESStatement<KeyConcept, R> statement = createElasticStatement(indexDefinition);
final DtListState usedListState = listState != null ? listState : defaultListState;
return statement.loadList(indexDefinition, searchQuery, usedListState, defaultMaxRows);
}
use of io.vertigo.dynamo.domain.model.DtListState in project vertigo by KleeGroup.
the class AbstractSearchManagerTest method doQueryAndGetFirst.
private Car doQueryAndGetFirst(final String query, final String sortField, final boolean sortDesc) {
// recherche
final SearchQuery searchQuery = SearchQuery.builder(ListFilter.of(query)).build();
final DtListState listState = new DtListState(null, 0, carIndexDefinition.getIndexDtDefinition().getField(sortField).getName(), sortDesc);
final DtList<Car> dtList = doQuery(searchQuery, listState).getDtList();
Assert.assertFalse("Result list was empty", dtList.isEmpty());
return dtList.get(0);
}
use of io.vertigo.dynamo.domain.model.DtListState in project vertigo by KleeGroup.
the class IndexFilterFunction method apply.
/**
* {@inheritDoc}
*/
@Override
public DtList<D> apply(final DtList<D> dtc) {
Assertion.checkNotNull(dtc);
// -----
final DtListState dtListState = new DtListState(top, skip, sortFieldName, sortDesc);
return indexPlugin.getCollection(keywords, searchedFields, listFilters, dtListState, Optional.empty(), dtc);
}
use of io.vertigo.dynamo.domain.model.DtListState in project vertigo by KleeGroup.
the class DtListStateDeserializer method deserialize.
@Override
public DtListState deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context) throws JsonParseException {
final JsonObject jsonObject = json.getAsJsonObject();
final Integer top = jsonObject.has("top") ? jsonObject.get("top").getAsInt() : null;
final int skip = jsonObject.has("skip") ? jsonObject.get("skip").getAsInt() : 0;
final String sortFieldName = jsonObject.has("sortFieldName") ? jsonObject.get("sortFieldName").getAsString() : null;
final Boolean sortDesc = jsonObject.has("sortDesc") ? jsonObject.get("sortDesc").getAsBoolean() : null;
return new DtListState(top, skip, sortFieldName, sortDesc);
}
Aggregations