use of com.odysseusinc.arachne.portal.service.impl.solr.FieldList in project ArachneCentralAPI by OHDSI.
the class SearchDTOToSolrQuery method convertToFullFacetsQuery.
/**
* @return query for getting "full" facets for all data (without filter and query)
*/
public SolrQuery convertToFullFacetsQuery(SearchDTO source) {
SolrQuery result = new SolrQuery();
FieldList solrFields = getSolrFields();
result.setRows(0);
result.setStart(0);
setQuery(source, result);
setFacets(source, result, solrFields);
return result;
}
use of com.odysseusinc.arachne.portal.service.impl.solr.FieldList in project ArachneCentralAPI by OHDSI.
the class SearchDTOToSolrQuery method convert.
public SolrQuery convert(SearchDTO source) {
final SolrQuery result = new SolrQuery();
final FieldList solrFields = getSolrFields();
setSorting(source, result, solrFields);
setPagination(source, result);
setOutputFields(result, source.getResultFields());
setQuery(source, result);
setFilters(source, result, solrFields);
setFacets(source, result, solrFields);
setCollections(source, result);
return result;
}
use of com.odysseusinc.arachne.portal.service.impl.solr.FieldList in project ArachneCentralAPI by OHDSI.
the class SearchResultToFacetedSearchResultDTOConverter method buildFacets.
protected Map<String, FacetOptionList> buildFacets(SearchResult source, FieldList solrFields) {
Map<String, List<String>> excludedOptions = source.getExcludedOptions();
NamedList response = source.getSolrResponse().getResponse();
Map facetsMap = (Map) response.asMap(10).get("facets");
Map<String, FacetOptionList> facets = new HashMap<>();
// Facets for option list and numeric type
List<FacetField> facetFieldList = source.getSolrResponse().getFacetFields();
if (facetFieldList != null) {
for (FacetField facetField : facetFieldList) {
FacetOptionList facetOptionList = getFacetOptionList(facetsMap, facetField.getName(), excludedOptions.get(facetField.getName()));
facets.put(solrFields.getBySolrName(facetField.getName()).getName(), facetOptionList);
}
}
return facets;
}
use of com.odysseusinc.arachne.portal.service.impl.solr.FieldList in project ArachneCentralAPI by OHDSI.
the class BaseSolrServiceImpl method getFieldsOfClass.
public FieldList<T> getFieldsOfClass(final Class<?> entity) {
final FieldList<T> result = new FieldList<>();
final List<Field> fields = getDeclaredFields(entity);
for (final Field field : fields) {
final T solrField = getSolrField(field);
if (solrField != null) {
result.add(solrField);
}
}
result.addAll(gatherClassSolrAnnotations(entity));
return result;
}
use of com.odysseusinc.arachne.portal.service.impl.solr.FieldList in project ArachneCentralAPI by OHDSI.
the class BaseUserServiceImpl method getSolrFields.
@Override
public FieldList getSolrFields() {
FieldList fieldList = new FieldList();
fieldList.addAll(solrService.getFieldsOfClass(User.class));
fieldList.addAll(getExtraSolrFields());
return fieldList;
}
Aggregations