}
public Result<QProfileActivity> searchActivities(QProfileActivityQuery query, QueryContext options) {
DbSession session = db.openSession(false);
try {
OrFilterBuilder activityFilter = FilterBuilders.orFilter();
for (String profileKey : query.getQprofileKeys()) {
activityFilter.add(FilterBuilders.nestedFilter("details",
QueryBuilders.matchQuery("details.profileKey", profileKey)));
}
SearchResponse response = index.get(ActivityIndex.class).search(query, options, activityFilter);
Result<QProfileActivity> result = new Result<QProfileActivity>(response);