Skip to content

Commit

Permalink
The last API work means that we are no longer piggybacking on all the…
Browse files Browse the repository at this point in the history
… solr param creation logic. Partially reimplemented here. Right now, facets are duplicated, and the files are not rendering
  • Loading branch information
mccalluc committed Jun 28, 2017
1 parent 60cb66f commit c57fc63
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions refinery/data_set_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import time
import urlparse

import requests
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Q
from django.utils.http import urlquote, urlunquote

from guardian.shortcuts import get_objects_for_user
import requests
from requests.exceptions import HTTPError

import core
Expand Down Expand Up @@ -613,10 +614,18 @@ def _generate_solr_params(params, assay_uuids, facets_from_config=False):

if facets_from_config:
# Twice as many facets as necessary, but easier than the alternative.
template = '&facet.field={0}_Characteristics_generic_s' + \
facet_template = '&facet.field={0}_Characteristics_generic_s' + \
'&facet.field={0}_Factor_Value_generic_s'
solr_params += ''.join([template.format(s) for s
in settings.USER_FILES_FACETS.split(",")])
solr_params += ''.join(
[facet_template.format(s) for s
in settings.USER_FILES_FACETS.split(",")])

field_template = '{0}_Characteristics_generic_s,' + \
'{0}_Factor_Value_generic_s'
solr_params += '&fl=' + ','.join(
[field_template.format(s) for s
in settings.USER_FILES_FACETS.split(",")
+ settings.USER_FILES_COLUMNS.split(",")])
elif facet_field:
facet_field = facet_field.split(',')
facet_field = insert_facet_field_filter(facet_filter, facet_field)
Expand Down

0 comments on commit c57fc63

Please sign in to comment.