Sfoglia il codice sorgente

[search] Trailing whitespaces and tabs cleanup

Romain Rigaux 11 anni fa
parent
commit
7ce38bb
48 ha cambiato i file con 1002 aggiunte e 1002 eliminazioni
  1. 31 31
      apps/search/src/search/api.py
  2. 1 1
      apps/search/src/search/decorators.py
  3. 4 4
      apps/search/src/search/examples.py
  4. 10 10
      apps/search/src/search/fixtures/initial_search_examples.json
  5. 28 28
      apps/search/src/search/models.py
  6. 1 1
      apps/search/src/search/search_controller.py
  7. 3 3
      apps/search/src/search/templates/admin_collections.mako
  8. 2 2
      apps/search/src/search/templates/no_collections.mako
  9. 75 75
      apps/search/src/search/templates/search.mako
  10. 24 24
      apps/search/src/search/tests.py
  11. 2 2
      apps/search/src/search/urls.py
  12. 57 57
      apps/search/src/search/views.py
  13. 3 3
      apps/search/static/help/index.html
  14. 5 5
      apps/search/static/js/charts.ko.js
  15. 6 6
      apps/search/static/js/nv.d3.growingMultiBarChart.js
  16. 185 185
      apps/search/static/js/search.ko.js
  17. 1 1
      apps/search/static/js/search.utils.js
  18. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/admin-extra.html
  19. 4 4
      desktop/libs/indexer/src/data/solr_configs/conf/currency.xml
  20. 2 2
      desktop/libs/indexer/src/data/solr_configs/conf/elevate.xml
  21. 19 19
      desktop/libs/indexer/src/data/solr_configs/conf/lang/contractions_it.txt
  22. 55 55
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stoptags_ja.txt
  23. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ar.txt
  24. 6 6
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ca.txt
  25. 2 2
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_el.txt
  26. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_fi.txt
  27. 8 8
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_hi.txt
  28. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_hu.txt
  29. 6 6
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_lv.txt
  30. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ro.txt
  31. 3 3
      desktop/libs/indexer/src/data/solr_configs/conf/mapping-FoldToASCII.txt
  32. 61 61
      desktop/libs/indexer/src/data/solr_configs/conf/schema.xml
  33. 169 169
      desktop/libs/indexer/src/data/solr_configs/conf/solrconfig.xml
  34. 170 170
      desktop/libs/indexer/src/data/solr_configs/conf/solrconfig.xml.secure
  35. 4 4
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/VM_global_library.vm
  36. 4 4
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/jquery.autocomplete.css
  37. 9 9
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/jquery.autocomplete.js
  38. 7 7
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/main.css
  39. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/query_group.vm
  40. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/query_spatial.vm
  41. 1 1
      desktop/libs/indexer/src/data/solr_configs/conf/velocity/richtext_doc.vm
  42. 7 7
      desktop/libs/indexer/src/data/solr_configs/conf/xslt/example.xsl
  43. 4 4
      desktop/libs/indexer/src/data/solr_configs/conf/xslt/example_atom.xsl
  44. 3 3
      desktop/libs/indexer/src/data/solr_configs/conf/xslt/example_rss.xsl
  45. 4 4
      desktop/libs/indexer/src/data/solr_configs/conf/xslt/luke.xsl
  46. 3 3
      desktop/libs/indexer/src/data/solr_configs/conf/xslt/updateXml.xsl
  47. 3 3
      desktop/libs/indexer/src/indexer/templates/collections.mako
  48. 3 3
      desktop/libs/indexer/static/help/index.html

+ 31 - 31
apps/search/src/search/api.py

@@ -51,11 +51,11 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       SLOTS = 10
     else:
       SLOTS = 100
-      
+
     stats_json = solr_api.stats(collection['name'], [facet_field])
     stat_facet = stats_json['stats']['stats_fields'][facet_field]
     is_date = False
-    
+
     # to refactor
     if isinstance(stat_facet['min'], numbers.Number):
       stats_min = int(stat_facet['min']) # Cast floats to int currently
@@ -63,7 +63,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       if start is None:
         if widget_type == 'line-widget':
           start, _ = _round_thousand_range(stats_min)
-        else:        
+        else:
           start, _ =  _round_number_range(stats_min)
       else:
         start = int(start)
@@ -71,12 +71,12 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
         if widget_type == 'line-widget':
           _, end = _round_thousand_range(stats_max)
         else:
-          _, end = _round_number_range(stats_max)        
+          _, end = _round_number_range(stats_max)
       else:
         end = int(end)
 
       if gap is None:
-        gap = int((end - start) / SLOTS)      
+        gap = int((end - start) / SLOTS)
       if gap < 1:
         gap = 1
     elif 'T' in stat_facet['min']:
@@ -84,13 +84,13 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       stats_min = stat_facet['min']
       stats_max = stat_facet['max']
       if start is None:
-        start = stats_min 
+        start = stats_min
       start = re.sub('\.\d\d?\d?Z$', 'Z', start)
       try:
         start_ts = datetime.strptime(start, '%Y-%m-%dT%H:%M:%SZ')
-      except Exception, e:        
-        LOG.error('Bad date: %s' % e)        
-        start_ts = datetime.strptime('1970-01-01T00:00:00Z', '%Y-%m-%dT%H:%M:%SZ')        
+      except Exception, e:
+        LOG.error('Bad date: %s' % e)
+        start_ts = datetime.strptime('1970-01-01T00:00:00Z', '%Y-%m-%dT%H:%M:%SZ')
       start_ts, _ = _round_date_range(start_ts)
       start = start_ts.strftime('%Y-%m-%dT%H:%M:%SZ')
       stats_min = min(stats_min, start)
@@ -106,7 +106,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       end = end_ts.strftime('%Y-%m-%dT%H:%M:%SZ')
       stats_max = max(stats_max, end)
       difference = (
-          mktime(end_ts.timetuple()) - 
+          mktime(end_ts.timetuple()) -
           mktime(start_ts.timetuple())
       ) / SLOTS
 
@@ -119,7 +119,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       elif difference < 60 * 10:
         gap = '+10MINUTES'
       elif difference < 60 * 30:
-        gap = '+30MINUTES'                
+        gap = '+30MINUTES'
       elif difference < 3600:
         gap = '+1HOURS'
       elif difference < 3600 * 3:
@@ -129,11 +129,11 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       elif difference < 3600 * 24:
         gap = '+1DAYS'
       elif difference < 3600 * 24 * 7:
-        gap = '+7DAYS'        
+        gap = '+7DAYS'
       elif difference < 3600 * 24 * 40:
-        gap = '+1MONTHS'        
+        gap = '+1MONTHS'
       else:
-        gap = '+1YEARS'      
+        gap = '+1YEARS'
 
     properties.update({
       'min': stats_min,
@@ -151,7 +151,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
 
 def _round_date_range(tm):
   start = tm - timedelta(minutes=tm.minute, seconds=tm.second, microseconds=tm.microsecond)
-  end = start + timedelta(minutes=60)  
+  end = start + timedelta(minutes=60)
   return start, end
 
 def _round_number_range(n):
@@ -161,7 +161,7 @@ def _round_number_range(n):
     i = int(log(n, 10))
     end = round(n, -i)
     start = end - 10 ** i
-    return start, end 
+    return start, end
 
 def _round_thousand_range(n):
   if n <= 10:
@@ -170,7 +170,7 @@ def _round_thousand_range(n):
     i = int(log(n, 10))
     start = 10 ** i
     end = 10 ** (i + 1)
-    return start, end 
+    return start, end
 
 def _guess_gap(solr_api, collection, facet, start=None, end=None):
   properties = {}
@@ -204,14 +204,14 @@ class SolrApi(BaseSolrApi):
 
   #@demo_handler
   def query(self, collection, query):
-    solr_query = {}      
-    
+    solr_query = {}
+
     solr_query['collection'] = collection['name']
     solr_query['rows'] = min(int(collection['template']['rows'] or 10), 1000)
     solr_query['start'] = min(int(query['start']), 10000)
-    
+
     q_template = '(%s)' if len(query['qs']) >= 2 else '%s'
-          
+
     params = self._get_params() + (
         ('q', 'OR'.join([q_template % (q['q'] or EMPTY_QUERY.get()) for q in query['qs']])),
         ('wt', 'json'),
@@ -227,7 +227,7 @@ class SolrApi(BaseSolrApi):
       )
       for facet in collection['facets']:
         if facet['type'] == 'query':
-          params += (('facet.query', '%s' % facet['field']),)          
+          params += (('facet.query', '%s' % facet['field']),)
         elif facet['type'] == 'range':
           params += tuple([
              ('facet.range', '{!ex=%s}%s' % (facet['field'], facet['field'])),
@@ -235,7 +235,7 @@ class SolrApi(BaseSolrApi):
              ('f.%s.facet.range.end' % facet['field'], facet['properties']['end']),
              ('f.%s.facet.range.gap' % facet['field'], facet['properties']['gap']),
              ('f.%s.facet.mincount' % facet['field'], facet['properties']['mincount']),]
-          )          
+          )
         elif facet['type'] == 'field':
           params += (
               ('facet.field', '{!ex=%s}%s' % (facet['field'], facet['field'])),
@@ -245,10 +245,10 @@ class SolrApi(BaseSolrApi):
 
     for fq in query['fqs']:
       if fq['type'] == 'field':
-        # This does not work if spaces in Solr: 
+        # This does not work if spaces in Solr:
         # params += (('fq', ' '.join([urllib.unquote(utf_quoter('{!tag=%s}{!field f=%s}%s' % (fq['field'], fq['field'], _filter))) for _filter in fq['filter']])),)
         f = []
-        for _filter in fq['filter']:          
+        for _filter in fq['filter']:
           if _filter is not None and ' ' in _filter:
             f.append('%s:"%s"' % (fq['field'], _filter))
           else:
@@ -277,7 +277,7 @@ class SolrApi(BaseSolrApi):
           if attribute_field[0]['sort']['direction']:
             fields.append('%s %s' % (field, attribute_field[0]['sort']['direction']))
       if fields:
-        params += (         
+        params += (
           ('sort', ','.join(fields)),
         )
 
@@ -371,7 +371,7 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
       )
       response = self._root.get('%(core)s/admin/luke' % {'core': core}, params=params)
-      return self._get_json(response)    
+      return self._get_json(response)
     except RestException, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
 
@@ -381,10 +381,10 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
       )
       response = self._root.get('%(core)s/schema/fields' % {'core': core}, params=params)
-      return self._get_json(response)    
+      return self._get_json(response)
     except RestException, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
-    
+
   def stats(self, core, fields):
     try:
       params = (
@@ -392,7 +392,7 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
           ('rows', 0),
           ('stats', 'true'),
-      )      
+      )
       params += tuple([('stats.field', field) for field in fields])
       response = self._root.get('%(core)s/select' % {'core': core}, params=params)
       return self._get_json(response)
@@ -404,7 +404,7 @@ class SolrApi(BaseSolrApi):
       params = (
           ('id', doc_id),
           ('wt', 'json'),
-      )      
+      )
       response = self._root.get('%(core)s/get' % {'core': core}, params=params)
       return self._get_json(response)
     except RestException, e:

+ 1 - 1
apps/search/src/search/decorators.py

@@ -45,7 +45,7 @@ def allow_writer_only(view_func):
     collection_json = json.loads(request.POST.get('collection', '{}'))
     collection = Collection.objects.get(id=collection_json['id']) # TODO perms with doc model HUE-1987
 
-    if not request.user.is_superuser: 
+    if not request.user.is_superuser:
       message = _("Permission denied. You are not an Administrator.")
       raise PopupException(message)
 

+ 4 - 4
apps/search/src/search/examples.py

@@ -28,11 +28,11 @@ def demo_handler(view_fn):
       return view_fn(request, *args, **kwargs)
     except Exception, e:
       from search.api import SolrApi
-      if '/solr/twitter_demo/select' in str(e):      
+      if '/solr/twitter_demo/select' in str(e):
         return SolrApi._get_json(TWITTER_SEARCH_RESPONSE)
-      elif '/solr/yelp_demo/select' in str(e):        
-        return SolrApi._get_json(YELP_SEARCH_RESPONSE)      
-      elif '/solr/log_demo/select' in str(e):        
+      elif '/solr/yelp_demo/select' in str(e):
+        return SolrApi._get_json(YELP_SEARCH_RESPONSE)
+      elif '/solr/log_demo/select' in str(e):
         return SolrApi._get_json(LOG_SEARCH_RESPONSE)
       else:
         raise e

File diff suppressed because it is too large
+ 10 - 10
apps/search/src/search/fixtures/initial_search_examples.json


+ 28 - 28
apps/search/src/search/models.py

@@ -208,10 +208,10 @@ class Sorting(models.Model):
 
 
 class CollectionManager(models.Manager):
- 
+
   def create2(self, name, label, is_core_only=False):
     facets = Facet.objects.create()
-    result = Result.objects.create()      
+    result = Result.objects.create()
     sorting = Sorting.objects.create()
 
     collection = Collection.objects.create(
@@ -251,7 +251,7 @@ class Collection(models.Model):
   def get_c(self, user):
     props = self.properties_dict
 
-    if 'collection' not in props:      
+    if 'collection' not in props:
       props['collection'] = self.get_default(user)
       if self.cores != '{}': # Convert collections from < Hue 3.6
         try:
@@ -260,8 +260,8 @@ class Collection(models.Model):
           LOG.error('Could not import collection: %s' % e)
 
     if 'layout' not in props:
-      props['layout'] = []    
-  
+      props['layout'] = []
+
     if self.id:
       props['collection']['id'] = self.id
     if self.name:
@@ -270,21 +270,21 @@ class Collection(models.Model):
       props['collection']['label'] = self.label
     if self.enabled is not None:
       props['collection']['enabled'] = self.enabled
-    
+
     # tmp for dev
     if 'rows' not in props['collection']['template']:
       props['collection']['template']['rows'] = 10
     if 'enabled' not in props['collection']:
       props['collection']['enabled'] = True
-      
+
     return json.dumps(props)
 
-  def get_default(self, user):      
+  def get_default(self, user):
     fields = self.fields_data(user)
     id_field = [field['name'] for field in fields if field.get('isId')]
     if id_field:
       id_field = id_field[0]
-  
+
     TEMPLATE = {
       "extracode": escape("<style type=\"text/css\">\nem {\n  font-weight: bold;\n  background-color: yellow;\n}</style>\n\n<script>\n</script>"),
       "highlighting": [""],
@@ -295,21 +295,21 @@ class Collection(models.Model):
           <div class="span12">%s</div>
         </div>
         <br/>
-      </div>""" % ' '.join(['{{%s}}' % field['name'] for field in fields]), 
+      </div>""" % ' '.join(['{{%s}}' % field['name'] for field in fields]),
       "isGridLayout": True,
       "showFieldList": True,
       "fieldsAttributes": [self._make_gridlayout_header_field(field) for field in fields],
       "fieldsSelected": [],
       "rows": 10,
     }
-    
+
     FACETS = []
 
     return {
       'id': self.id, 'name': self.name, 'label': self.label, 'enabled': self.enabled,
-      'template': TEMPLATE, 'facets': FACETS, 
-      'fields': fields, 'idField': id_field, 
-    }          
+      'template': TEMPLATE, 'facets': FACETS,
+      'fields': fields, 'idField': id_field,
+    }
 
   @classmethod
   def _make_field(cls, field, attributes):
@@ -319,7 +319,7 @@ class Collection(models.Model):
         'isId': attributes.get('required') and attributes.get('uniqueKey'),
         'isDynamic': 'dynamicBase' in attributes
     }
-  
+
   @classmethod
   def _make_gridlayout_header_field(cls, field, isDynamic=False):
     return {'name': field['name'], 'sort': {'direction': None}, 'isDynamic': isDynamic}
@@ -344,11 +344,11 @@ class Collection(models.Model):
 
     # Backward compatibility conversions
     if 'autocomplete' not in properties_python:
-      properties_python['autocomplete'] = False    
+      properties_python['autocomplete'] = False
     if 'collection' in properties_python:
       if 'showFieldList' not in properties_python['collection']['template']:
         properties_python['collection']['template']['showFieldList'] = True
-    
+
     return properties_python
 
   def update_properties(self, post_data):
@@ -392,11 +392,11 @@ class Collection(models.Model):
                "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]
           }], "drops":["temp"],"klass":"card card-home card-column span10"}
      ]
-    
+
     from search.views import _create_facet
-    
+
     props['collection']['facets'] =[]
-    facets = self.facets.get_data()         
+    facets = self.facets.get_data()
 
     for facet_id in facets['order']:
       for facet in facets['fields'] + facets['ranges']:
@@ -453,7 +453,7 @@ def augment_solr_response(response, collection, query):
         collection_facet = get_facet_field(category, name, collection['facets'])
         counts = pairwise2(name, selected_values.get((facet['id'], name, category), []), response['facet_counts']['facet_fields'][name])
         if collection_facet['properties']['sort'] == 'asc':
-          counts.reverse()          
+          counts.reverse()
         facet = {
           'id': collection_facet['id'],
           'field': name,
@@ -489,12 +489,12 @@ def augment_solr_response(response, collection, query):
             'type': category,
             'label': name,
             'count': value,
-          }        
+          }
           normalized_facets.append(facet)
-      # pivot_facet          
+      # pivot_facet
 
   # HTML escaping
-  for doc in response['response']['docs']:  
+  for doc in response['response']['docs']:
     for field, value in doc.iteritems():
       if isinstance(value, numbers.Number):
         escaped_value = value
@@ -504,10 +504,10 @@ def augment_solr_response(response, collection, query):
       doc[field] = escaped_value
     doc['showDetails'] = False
     doc['details'] = []
-      
+
   highlighted_fields = response.get('highlighting', {}).keys()
   if highlighted_fields:
-    id_field = collection.get('idField')    
+    id_field = collection.get('idField')
     if id_field:
       for doc in response['response']['docs']:
         if id_field in doc and doc[id_field] in highlighted_fields:
@@ -524,7 +524,7 @@ def augment_solr_response(response, collection, query):
 def augment_solr_exception(response, collection):
   response.update(
   {
-    "facet_counts": {   
+    "facet_counts": {
     },
     "highlighting": {
     },
@@ -549,4 +549,4 @@ def augment_solr_exception(response, collection):
       "docs": [
       ]
     }
-  }) 
+  })

+ 1 - 1
apps/search/src/search/search_controller.py

@@ -91,6 +91,6 @@ class SearchController(object):
 
   def get_solr_collection(self):
     return SolrApi(SOLR_URL.get(), self.user).collections()
-  
+
   def get_all_indexes(self):
     return self.get_solr_collection().keys() + SolrApi(SOLR_URL.get(), self.user).cores().keys()

+ 3 - 3
apps/search/src/search/templates/admin_collections.mako

@@ -43,10 +43,10 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
       <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && !isLoading()">
       &nbsp;
       &nbsp;
-      <a data-bind="visible: collections().length > 0 && !isLoading()" class="btn" href="${ url('search:new_search') }" title="${ _('Create a new dashboard') }"><i class="fa fa-plus-circle"></i> ${ _('Dashboard') }</a>      
+      <a data-bind="visible: collections().length > 0 && !isLoading()" class="btn" href="${ url('search:new_search') }" title="${ _('Create a new dashboard') }"><i class="fa fa-plus-circle"></i> ${ _('Dashboard') }</a>
     </%def>
 
-    <%def name="creation()">    
+    <%def name="creation()">
     </%def>
   </%actionbar:render>
 
@@ -57,7 +57,7 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
         ${ _('There are currently no dashboards defined.') }<br/>
         <a class="btn importBtn" href="${ url('search:new_search') }">
           <i class="fa fa-plus-circle"></i> ${ _('Dashboard') }
-        </a> 
+        </a>
       </h1>
     </div>
   </div>

+ 2 - 2
apps/search/src/search/templates/no_collections.mako

@@ -49,13 +49,13 @@ ${ commonheader(_('Search'), "search", user, "120px") | n,unicode }
         ${ _('... First create a search dashboard with ') }
         <a class="btn importBtn" href="${ url('search:new_search') }">
           <i class="fa fa-file-o"></i> ${ _('Dashboard') }
-        </a>      
+        </a>
       </h1>
       <h1>
         ${ _('... or create a search index with ') }
         <a class="btn importBtn" href="${ url('indexer:collections') }">
           <i class="fa fa-database"></i> ${ _('Indexer') }
-        </a>      
+        </a>
       </h1>
       % endif
     </div>

+ 75 - 75
apps/search/src/search/templates/search.mako

@@ -44,17 +44,17 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       &nbsp;&nbsp;&nbsp;
       <a class="btn" href="${ url('search:new_search') }" title="${ _('New') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}"><i class="fa fa-file-o"></i></a>
       <a class="btn" href="${ url('search:admin_collections') }" title="${ _('Collections') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}"><i class="fa fa-tags"></i></a>
-    % endif 
-  </div>  
-  
-  <form data-bind="visible: $root.isEditing() && columns().length == 0">  
+    % endif
+  </div>
+
+  <form data-bind="visible: $root.isEditing() && columns().length == 0">
     ${ _('Select a search index') }
     <!-- ko if: columns().length == 0 -->
     <select data-bind="options: $root.initial.collections, value: $root.collection.name">
     </select>
     <!-- /ko -->
   </form>
-  
+
   <form class="form-search" style="margin: 0" data-bind="submit: searchBtn, visible: columns().length != 0">
     <strong>${_("Search")}</strong>
     <div class="input-append">
@@ -111,8 +111,8 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableResultset() },
-                    draggable: {data: draggableHtmlResultset(), 
-                    isEnabled: availableDraggableResultset, 
+                    draggable: {data: draggableHtmlResultset(),
+                    isEnabled: availableDraggableResultset,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)}); $root.collection.template.isGridLayout(false); }}}"
          title="${_('HTML Results')}" rel="tooltip" data-placement="top">
@@ -121,7 +121,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
-                    draggable: {data: draggableFacet(), isEnabled: availableDraggableChart, 
+                    draggable: {data: draggableFacet(), isEnabled: availableDraggableChart,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Text Facet')}" rel="tooltip" data-placement="top">
@@ -130,7 +130,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
-                    draggable: {data: draggablePie(), isEnabled: availableDraggableChart, 
+                    draggable: {data: draggablePie(), isEnabled: availableDraggableChart,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Pie Chart')}" rel="tooltip" data-placement="top">
@@ -140,7 +140,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
     </div>
     <!-- <div class="draggable-widget" data-bind="draggable: {data: draggableHit(), options: {'start': function(event, ui){$('.card-body').slideUp('fast');}, 'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}" title="${_('Hit Count')}" rel="tooltip" data-placement="top"><a data-bind="attr: {href: $root.availableDraggableResultset()}, css: {'btn-inverse': ! $root.availableDraggableResultset() }, style: { cursor: $root.availableDraggableResultset() ? 'move' : 'default' }"><i class="fa fa-tachometer"></i></a></div> -->
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
-                    draggable: {data: draggableBar(), isEnabled: availableDraggableChart, 
+                    draggable: {data: draggableBar(), isEnabled: availableDraggableChart,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Bar Chart')}" rel="tooltip" data-placement="top">
@@ -149,7 +149,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableNumbers() },
-                    draggable: {data: draggableLine(), isEnabled: availableDraggableNumbers, 
+                    draggable: {data: draggableLine(), isEnabled: availableDraggableNumbers,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Line Chart')}" rel="tooltip" data-placement="top">
@@ -158,7 +158,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableHistogram() },
-                    draggable: {data: draggableHistogram(), isEnabled: availableDraggableHistogram, 
+                    draggable: {data: draggableHistogram(), isEnabled: availableDraggableHistogram,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Timeline')}" rel="tooltip" data-placement="top">
@@ -167,7 +167,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableFilter() },
-                    draggable: {data: draggableFilter(), isEnabled: availableDraggableFilter, 
+                    draggable: {data: draggableFilter(), isEnabled: availableDraggableFilter,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Filter Bar')}" rel="tooltip" data-placement="top">
@@ -176,7 +176,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
          </a>
     </div>
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
-                    draggable: {data: draggableMap(), isEnabled: availableDraggableChart, 
+                    draggable: {data: draggableMap(), isEnabled: availableDraggableChart,
                     options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
                               'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
          title="${_('Map')}" rel="tooltip" data-placement="top">
@@ -257,9 +257,9 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       </div>
     </div>
     <div data-bind="css: {'row-fluid': true, 'row-container':true, 'is-editing': $root.isEditing},
-        sortable: { template: 'widget-template', data: widgets, isEnabled: $root.isEditing, 
-        options: {'handle': '.move-widget', 'opacity': 0.7, 'placeholder': 'row-highlight', 'greedy': true, 
-            'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}, 
+        sortable: { template: 'widget-template', data: widgets, isEnabled: $root.isEditing,
+        options: {'handle': '.move-widget', 'opacity': 0.7, 'placeholder': 'row-highlight', 'greedy': true,
+            'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});},
             'helper': function(event){lastWindowScrollPosition = $(window).scrollTop(); $('.card-body').slideUp('fast'); var _par = $('<div>');_par.addClass('card card-widget');var _title = $('<h2>');_title.addClass('card-heading simple');_title.text($(event.toElement).text());_title.appendTo(_par);_par.height(80);_par.width(180);return _par;}},
             dragged: function(widget){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});showAddFacetDemiModal(widget);viewModel.search()}}">
     </div>
@@ -299,9 +299,9 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 <script type="text/html" id="hit-widget">
   <!-- ko if: $root.getFacetFromQuery(id()) -->
   <div class="row-fluid" data-bind="with: $root.getFacetFromQuery(id())">
-    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">      
+    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">
       ${ _('Label') }: <input type="text" data-bind="value: label" />
-    </div>  
+    </div>
 
     <span data-bind="text: query" />: <span data-bind="text: count" />
   </div>
@@ -310,7 +310,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 
 <script type="text/html" id="facet-toggle">
     <!-- ko if: type() == 'range' -->
-      <!-- ko ifnot: properties.isDate() -->    
+      <!-- ko ifnot: properties.isDate() -->
         <div class="slider-cnt" data-bind="slider: {start: properties.start, end: properties.end, gap: properties.gap, min: properties.min, max: properties.max}"></div>
       <!-- /ko -->
       <!-- ko if: properties.isDate() -->
@@ -347,14 +347,14 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       </span>
     </div>
     <div data-bind="with: $root.collection.getFacetById($parent.id())">
-	    <!-- ko if: type() != 'range' -->
+      <!-- ko if: type() != 'range' -->
         <div data-bind="foreach: $parent.counts">
           <div>
-            <a href="javascript: void(0)">              
+            <a href="javascript: void(0)">
               <!-- ko if: $index() != $parent.properties.limit() -->
                 <!-- ko if: ! $data.selected -->
                   <span data-bind="text: $data.value, click: function(){ $root.query.toggleFacet({facet: $data, widget_id: $parent.id()}) }"></span>
-                  <span class="counter" data-bind="text: ' (' + $data.count + ')', click: function(){ $root.query.toggleFacet({facet: $data, widget_id: $parent.id()}) }"></span>                
+                  <span class="counter" data-bind="text: ' (' + $data.count + ')', click: function(){ $root.query.toggleFacet({facet: $data, widget_id: $parent.id()}) }"></span>
                 <!-- /ko -->
                 <!-- ko if: $data.selected -->
                   <span data-bind="click: function(){ $root.query.toggleFacet({facet: $data, widget_id: $parent.id()}) }">
@@ -372,23 +372,23 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
                 <!-- ko if: $parent.properties.prevLimit != undefined && $parent.properties.prevLimit != $parent.properties.limit() -->
                   <span data-bind="click: function(){ $root.collection.upDownFacetLimit($parent.id(), 'up') }">
                     ${ _('Show more') }
-                  </span> 
-                  /             
+                  </span>
+                  /
                   <span data-bind="click: function(){ $root.collection.upDownFacetLimit($parent.id(), 'down') }">
                     ${ _('less...') }
-                  </span>                    
+                  </span>
                 </span>
                 <!-- /ko -->
               <!-- /ko -->
             </a>
           </div>
         </div>
-	    <!-- /ko -->
-	    <!-- ko if: type() == 'range' -->
+      <!-- /ko -->
+      <!-- ko if: type() == 'range' -->
         <div data-bind="foreach: $parent.counts">
           <div>
             <a href="javascript: void(0)">
-              <!-- ko if: ! selected --> 
+              <!-- ko if: ! selected -->
                 <span data-bind="click: function(){ $root.query.selectRangeFacet({count: $data.value, widget_id: $parent.id(), from: $data.from, to: $data.to, cat: $data.field}) }">
                   <span data-bind="text: $data.from + ' - ' + $data.to"></span>
                   <span class="counter" data-bind="text: ' (' + $data.value + ')'"></span>
@@ -403,7 +403,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
             </a>
           </div>
         </div>
-	    <!-- /ko -->    
+      <!-- /ko -->
     </div>
   </div>
   <!-- /ko -->
@@ -453,7 +453,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       <div data-bind="visible: !$root.isRetrievingResults() && $root.results().length == 0">
         ${ _('Your search did not match any documents.') }
       </div>
-    
+
       <!-- ko if: $root.response().response -->
         <div data-bind="template: {name: 'resultset-pagination', data: $root.response() }" style="padding: 8px; color: #666"></div>
       <!-- /ko -->
@@ -507,23 +507,23 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
                 <td data-bind="html: $data"></td>
               <!-- /ko -->
             </tr>
-            <tr data-bind="visible: showDetails">                        
-              <td data-bind="attr: {'colspan': $root.collection.template.fieldsSelected().length > 0 ? $root.collection.template.fieldsSelected().length + 1 : 2}">              
+            <tr data-bind="visible: showDetails">
+              <td data-bind="attr: {'colspan': $root.collection.template.fieldsSelected().length > 0 ? $root.collection.template.fieldsSelected().length + 1 : 2}">
                 <!-- ko if: $data.details().length == 0 -->
                  <!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
                  <!--[if IE]><img src="/static/art/spinner.gif" /><![endif]-->
                 <!-- /ko -->
-                <!-- ko if: $data.details().length > 0 -->                  
-				  <div class="document-details">
-				    <table>
-				      <tbody data-bind="foreach: details">
-				        <tr>
-				          <th style="text-align: left; white-space: nobreak; vertical-align:top; padding-right:20px", data-bind="text: key"></th> 
-				          <td width="100%" data-bind="text: value"></td>
-				        </tr>
-				      </tbody>
-				    </table>
-				  </div>                    
+                <!-- ko if: $data.details().length > 0 -->
+          <div class="document-details">
+            <table>
+              <tbody data-bind="foreach: details">
+                <tr>
+                  <th style="text-align: left; white-space: nobreak; vertical-align:top; padding-right:20px", data-bind="text: key"></th>
+                  <td width="100%" data-bind="text: value"></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
                 <!-- /ko -->
               </td>
             </tr>
@@ -619,11 +619,11 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       </div>
       <div class="widget-section widget-settings-section" style="display: none, min-height:200px">
         ${ _('Sorting') }
-        
+
         <div data-bind="foreach: $root.collection.template.fieldsSelected">
           <span data-bind="text: $data"></span>
         </div>
-        <br/>  
+        <br/>
       </div>
     <!-- /ko -->
 
@@ -631,15 +631,15 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       <div data-bind="visible: !$root.isRetrievingResults() && $root.results().length == 0">
         ${ _('Your search did not match any documents.') }
       </div>
-    
+
       <!-- ko if: $root.response().response -->
         <div data-bind="template: {name: 'resultset-pagination', data: $root.response() }"></div>
       <!-- /ko -->
-    
+
       <div id="result-container" data-bind="foreach: $root.results">
         <div class="result-row" data-bind="html: $data"></div>
-      </div>    
-    
+      </div>
+
       <div class="widget-spinner" data-bind="visible: $root.isRetrievingResults()">
         <!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
         <!--[if IE]><img src="/static/art/spinner.gif" /><![endif]-->
@@ -679,7 +679,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
         visible: ($root.collection.template.rows() * 1.0 + $data.response.start * 1.0) < $data.response.numFound,
         click: function() { $root.query.paginate('next') }">
     </i>
-  </a>  
+  </a>
 
   <!-- ko if: $data.response.numFound > 0 && $data.response.numFound <= 1000 -->
   <span class="pull-right">
@@ -703,10 +703,10 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 
   <!-- ko if: $root.getFacetFromQuery(id()) -->
   <div class="row-fluid" data-bind="with: $root.getFacetFromQuery(id())">
-    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">      
+    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">
       <span data-bind="template: { name: 'facet-toggle' }">
       </span>
-    </div>  
+    </div>
 
     <div style="padding-bottom: 10px; text-align: center">
       <a href="javascript:void(0)" data-bind="click: $root.collection.timeLineZoom"><i class="fa fa-search-minus"></i></a>
@@ -732,11 +732,11 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 
   <!-- ko if: $root.getFacetFromQuery(id()) -->
   <div class="row-fluid" data-bind="with: $root.getFacetFromQuery(id())">
-    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">      
+    <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">
       <span data-bind="template: { name: 'facet-toggle' }">
       </span>
-    </div> 
-    
+    </div>
+
     <div data-bind="with: $root.collection.getFacetById($parent.id())">
       <!-- ko if: type() == 'range' -->
         <a href="javascript:void(0)" data-bind="click: $root.collection.timeLineZoom"><i class="fa fa-search-minus"></i></a>
@@ -748,11 +748,11 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       transformer: barChartDataTransformer,
       onStateChange: function(state){ console.log(state); },
       onClick: function(d) {
-        if (d.obj.field != undefined) { 
+        if (d.obj.field != undefined) {
           viewModel.query.selectRangeFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field});
         } else {
           viewModel.query.toggleFacet({facet: d.obj, widget_id: d.obj.widget_id});
-        } 
+        }
       },
       onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: id}) },
       onComplete: function(){ viewModel.getWidgetById(id).isLoading(false) } }"
@@ -777,7 +777,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
     <a href="javascript:void(0)" data-bind="click: $root.collection.timeLineZoom"><i class="fa fa-search-minus"></i></a>
 
     <div data-bind="lineChart: {datum: {counts: counts, widget_id: $parent.id(), label: label}, field: field, label: label,
-      transformer: lineChartDataTransformer,      
+      transformer: lineChartDataTransformer,
       onClick: function(d){ viewModel.query.selectRangeFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field}) },
       onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
       onComplete: function(){ viewModel.getWidgetById(id).isLoading(false) } }"
@@ -800,7 +800,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       <div data-bind="pieChart: {data: {counts: $parent.counts, widget_id: $parent.id}, field: field, fqs: $root.query.fqs,
         transformer: rangePieChartDataTransformer,
         maxWidth: 250,
-        onClick: function(d){ viewModel.query.selectRangeFacet({count: d.data.obj.value, widget_id: d.data.obj.widget_id, from: d.data.obj.from, to: d.data.obj.to, cat: d.data.obj.field}) }, 
+        onClick: function(d){ viewModel.query.selectRangeFacet({count: d.data.obj.value, widget_id: d.data.obj.widget_id, from: d.data.obj.from, to: d.data.obj.to, cat: d.data.obj.field}) },
         onComplete: function(){ viewModel.getWidgetById($parent.id).isLoading(false)} }" />
       <!-- /ko -->
       <!-- ko if: type() != 'range' -->
@@ -810,7 +810,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
         onClick: function(d){viewModel.query.toggleFacet({facet: d.data.obj, widget_id: d.data.obj.widget_id})},
         onComplete: function(){viewModel.getWidgetById($parent.id).isLoading(false)}}" />
       <!-- /ko -->
-    </div>    
+    </div>
   </div>
   <!-- /ko -->
   <div class="widget-spinner" data-bind="visible: isLoading()">
@@ -857,7 +857,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
   <!-- ko if: $root.getFacetFromQuery(id()) -->
   <div class="row-fluid" data-bind="with: $root.getFacetFromQuery(id())">
     <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">
-      ${ _('Scope') }: 
+      ${ _('Scope') }:
       <select data-bind="selectedOptions: properties.scope" class="input-small">
         <option value="world">${ _("World") }</option>
         <option value="usa">${ _("USA") }</option>
@@ -1112,12 +1112,12 @@ function timelineChartDataTransformer(rawDatum) {
       obj: item
     });
   });
-  
+
   _datum.push({
     key: rawDatum.label,
     values: _data
   });
-  
+
 
   // If multi query
   $(rawDatum.extraSeries).each(function (cnt, item) {
@@ -1132,14 +1132,14 @@ function timelineChartDataTransformer(rawDatum) {
         y: item.value,
         obj: item
       });
-    });      
+    });
 
     _datum.push({
       key: item.label,
       values: _data
     });
   });
-  
+
   return _datum;
 }
 
@@ -1155,9 +1155,9 @@ function mapChartDataTransformer(data) {
   return _data;
 }
 
-function toggleDocDetails(doc) {  
+function toggleDocDetails(doc) {
   doc.showDetails(! doc.showDetails());
-  
+
   if (doc.details().length == 0) {
     viewModel.getDocument(doc);
   }
@@ -1471,8 +1471,8 @@ $(document).ready(function () {
 
       _tmpl.find(".start-date").val(moment(_options.min()).format(DATE_FORMAT));
       _tmpl.find(".start-date").datepicker({
-				format: DATE_FORMAT.toLowerCase()
-			}).on("changeDate", function () {
+        format: DATE_FORMAT.toLowerCase()
+      }).on("changeDate", function () {
         rangeHandler(true);
       });
 
@@ -1486,8 +1486,8 @@ $(document).ready(function () {
 
       _tmpl.find(".end-date").val(moment(_options.max()).format(DATE_FORMAT));
       _tmpl.find(".end-date").datepicker({
-				format: DATE_FORMAT.toLowerCase()
-			}).on("changeDate", function () {
+        format: DATE_FORMAT.toLowerCase()
+      }).on("changeDate", function () {
         rangeHandler(false);
       });
 
@@ -1888,12 +1888,12 @@ $(document).ready(function () {
 
   var selectedWidget = null;
   function showAddFacetDemiModal(widget) {
-    if (["resultset-widget", "html-resultset-widget", "filter-widget"].indexOf(widget.widgetType()) == -1) {      
+    if (["resultset-widget", "html-resultset-widget", "filter-widget"].indexOf(widget.widgetType()) == -1) {
       viewModel.collection.template.fieldsModalFilter("");
       viewModel.collection.template.fieldsModalType(widget.widgetType());
       viewModel.collection.template.fieldsModalFilter.valueHasMutated();
       $('#addFacetInput').typeahead({
-          'source': viewModel.collection.template.availableWidgetFieldsNames(), 
+          'source': viewModel.collection.template.availableWidgetFieldsNames(),
           'updater': function(item) {
               addFacetDemiModalFieldPreview({'name': function(){return item}});
               return item;
@@ -1919,7 +1919,7 @@ $(document).ready(function () {
       $("#addFacetDemiModal").modal("hide");
     }
   }
-  
+
   function addFacetDemiModalFieldCancel() {
     viewModel.removeWidget(selectedWidget);
   }

+ 24 - 24
apps/search/src/search/tests.py

@@ -76,7 +76,7 @@ class TestSearchBase(object):
 class TestWithMockedSolr(TestSearchBase):
   def _get_collection_param(self, collection):
     col_json = json.loads(collection.get_c(self.user))
-    return col_json['collection']    
+    return col_json['collection']
 
   def test_index(self):
     response = self.c.get(reverse('search:index'))
@@ -117,30 +117,30 @@ class TestWithMockedSolr(TestSearchBase):
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'category'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'comments'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'content'},
-         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'content_type'}, 
+         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'content_type'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'description'},
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'features'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'boolean', 'name': 'inStock'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'includes'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'keywords'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'date', 'name': 'last_modified'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'links'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'manu'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'manu_exact'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'name'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'payloads', 'name': 'payloads'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'int', 'name': 'popularity'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'float', 'name': 'price'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'resourcename'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_en_splitting_tight', 'name': 'sku'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'location', 'name': 'store'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'subject'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'text'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general_rev', 'name': 'text_rev'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'title'}, 
-         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'url'}, 
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'features'},
+         {'isDynamic': False, 'isId': None, 'type': 'boolean', 'name': 'inStock'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'includes'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'keywords'},
+         {'isDynamic': False, 'isId': None, 'type': 'date', 'name': 'last_modified'},
+         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'links'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'manu'},
+         {'isDynamic': False, 'isId': None, 'type': 'string', 'name': 'manu_exact'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'name'},
+         {'isDynamic': False, 'isId': None, 'type': 'payloads', 'name': 'payloads'},
+         {'isDynamic': False, 'isId': None, 'type': 'int', 'name': 'popularity'},
+         {'isDynamic': False, 'isId': None, 'type': 'float', 'name': 'price'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'resourcename'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_en_splitting_tight', 'name': 'sku'},
+         {'isDynamic': False, 'isId': None, 'type': 'location', 'name': 'store'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'subject'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'text'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general_rev', 'name': 'text_rev'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'title'},
+         {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'url'},
          {'isDynamic': False, 'isId': None, 'type': 'float', 'name': 'weight'},
-         {'isDynamic': False, 'isId': True, 'type': 'string', 'name': 'id'}], 
+         {'isDynamic': False, 'isId': True, 'type': 'string', 'name': 'id'}],
          self.collection.fields_data(self.user)
     )
 
@@ -155,7 +155,7 @@ class TestWithMockedSolr(TestSearchBase):
         'collection': json.dumps(self._get_collection_param(self.collection)),
         'query': json.dumps(QUERY)
     })
-    csv_response_content = csv_response.content    
+    csv_response_content = csv_response.content
     assert_equal('application/csv', csv_response['Content-Type'])
     assert_equal(7434, len(csv_response_content))
     assert_true('article_title,journal_issn,author,language,journal_title,journal_country,article_pagination,ontologies,affiliation,date_created,article_date,journal_iso_abbreviation,journal_publication_date,_version_,article_abstract_text,id' in csv_response_content, csv_response_content)

+ 2 - 2
apps/search/src/search/urls.py

@@ -24,7 +24,7 @@ urlpatterns = patterns('search.views',
   url(r'^new_search', 'new_search', name='new_search'),
   url(r'^browse/(?P<name>\w+)', 'browse', name='browse'),
   url(r'^download$', 'download', name='download'),
-  
+
   url(r'^admin/collections$', 'admin_collections', name='admin_collections'),
 
   # Ajax
@@ -37,7 +37,7 @@ urlpatterns = patterns('search.views',
   url(r'^get_timeline$', 'get_timeline', name='get_timeline'),
   url(r'^get_collection$', 'get_collection', name='get_collection'),
   url(r'^get_collections$', 'get_collections', name='get_collections'),
-  
+
   # Admin
   url(r'^admin/collection_delete$', 'admin_collection_delete', name='admin_collection_delete'),
   url(r'^admin/collection_copy$', 'admin_collection_copy', name='admin_collection_copy'),

+ 57 - 57
apps/search/src/search/views.py

@@ -48,7 +48,7 @@ LOG = logging.getLogger(__name__)
 def index(request):
   hue_collections = SearchController(request.user).get_search_collections()
   collection_id = request.GET.get('collection')
-  
+
   if not hue_collections or not collection_id:
     if request.user.is_superuser:
       return admin_collections(request, True)
@@ -61,7 +61,7 @@ def index(request):
   return render('search.mako', request, {
     'collection': collection,
     'query': query,
-    'initial': json.dumps({'collections': [], 'layout': []}),    
+    'initial': json.dumps({'collections': [], 'layout': []}),
   })
 
 
@@ -85,7 +85,7 @@ def new_search(request):
                   {"size":12,"name":"Grid Results","id":"52f07188-f30f-1296-2450-f77e02e1a5c0","widgetType":"resultset-widget",
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
               "drops":["temp"],"klass":"card card-home card-column span10"}
-         ] 
+         ]
      }),
   })
 
@@ -110,23 +110,23 @@ def browse(request, name):
                   {"size":12,"name":"Grid Results","id":"52f07188-f30f-1296-2450-f77e02e1a5c0","widgetType":"resultset-widget",
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
               "drops":["temp"],"klass":"card card-home card-column span10"}
-         ] 
+         ]
      }),
   })
 
 
 def search(request):
-  response = {}  
-  
+  response = {}
+
   collection = json.loads(request.POST.get('collection', '{}'))
   query = json.loads(request.POST.get('query', '{}'))
   # todo: remove the selected histo facet if multiq
 
   if collection['id']:
     hue_collection = Collection.objects.get(id=collection['id']) # TODO perms
-    
+
   if collection:
-    try:      
+    try:
       response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
       response = augment_solr_response(response, collection, query)
     except RestException, e:
@@ -136,7 +136,7 @@ def search(request):
         response['error'] = force_unicode(str(e))
     except Exception, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
-      
+
       response['error'] = force_unicode(str(e))
   else:
     response['error'] = _('There is no collection to search.')
@@ -149,13 +149,13 @@ def search(request):
 
 @allow_admin_only
 def save(request):
-  response = {'status': -1}  
-  
+  response = {'status': -1}
+
   collection = json.loads(request.POST.get('collection', '{}')) # TODO perms
-  layout = json.loads(request.POST.get('layout', '{}')) 
- 
+  layout = json.loads(request.POST.get('layout', '{}'))
+
   collection['template']['extracode'] = escape(collection['template']['extracode']) # Escape HTML
-  
+
   if collection:
     if collection['id']:
       hue_collection = Collection.objects.get(id=collection['id'])
@@ -180,14 +180,14 @@ def download(request):
   try:
     file_format = 'csv' if 'csv' in request.POST else 'xls' if 'xls' in request.POST else 'json'
     response = search(request)
-    
+
     if file_format == 'json':
       mimetype = 'application/json'
       json_docs = json.dumps(json.loads(response.content)['response']['docs'])
       resp = HttpResponse(json_docs, mimetype=mimetype)
       resp['Content-Disposition'] = 'attachment; filename=%s.%s' % ('query_result', file_format)
-      return resp    
-    
+      return resp
+
     return export_download(json.loads(response.content), file_format)
   except Exception, e:
     raise PopupException(_("Could not download search results: %s") % e)
@@ -266,20 +266,20 @@ def query_suggest(request, collection_id, query=""):
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def index_fields_dynamic(request):  
+def index_fields_dynamic(request):
   result = {'status': -1, 'message': 'Error'}
-  
+
   try:
     name = request.POST['name']
-            
-    hue_collection = Collection(name=name, label=name)    
-    
+
+    hue_collection = Collection(name=name, label=name)
+
     dynamic_fields = SolrApi(SOLR_URL.get(), request.user).luke(hue_collection.name)
 
     result['message'] = ''
     result['fields'] = [Collection._make_field(name, properties)
                         for name, properties in dynamic_fields['fields'].iteritems() if 'dynamicBase' in properties]
-    result['gridlayout_header_fields'] = [Collection._make_gridlayout_header_field({'name': name}, True) 
+    result['gridlayout_header_fields'] = [Collection._make_gridlayout_header_field({'name': name}, True)
                                           for name, properties in dynamic_fields['fields'].iteritems() if 'dynamicBase' in properties]
     result['status'] = 0
   except Exception, e:
@@ -288,13 +288,13 @@ def index_fields_dynamic(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def get_document(request):  
+def get_document(request):
   result = {'status': -1, 'message': 'Error'}
 
   try:
     collection = json.loads(request.POST.get('collection', '{}'))
     doc_id = request.POST.get('id')
-            
+
     if doc_id:
       result['doc'] = SolrApi(SOLR_URL.get(), request.user).get(collection['name'], doc_id)
       result['status'] = 0
@@ -302,14 +302,14 @@ def get_document(request):
     else:
       result['message'] = _('This document does not have any index id.')
       result['status'] = 1
-    
+
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
 
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def get_timeline(request):  
+def get_timeline(request):
   result = {'status': -1, 'message': 'Error'}
 
   try:
@@ -318,11 +318,11 @@ def get_timeline(request):
     facet = json.loads(request.POST.get('facet', '{}'))
     qdata = json.loads(request.POST.get('qdata', '{}'))
     multiQ = request.POST.get('multiQ', 'query')
-    
+
     if multiQ == 'query':
-      label = qdata['q'] 
+      label = qdata['q']
       query['qs'] = [qdata]
-    elif facet['type'] == 'range':      
+    elif facet['type'] == 'range':
       _prop = filter(lambda prop: prop['from'] == qdata, facet['properties'])[0]
       label = '%(from)s - %(to)s ' % _prop
       facet_id = facet['id']
@@ -336,16 +336,16 @@ def get_timeline(request):
       # Only care about our current field:value filter
       for fq in query['fqs']:
         if fq['id'] == facet_id:
-          fq['filter'] = [qdata] 
-      
+          fq['filter'] = [qdata]
+
     # Remove other facets from collection for speed
     collection['facets'] = filter(lambda f: f['widgetType'] == 'histogram-widget', collection['facets'])
-    
+
     response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
     response = augment_solr_response(response, collection, query)
-  
+
     label += ' (%s) ' % response['response']['numFound']
-  
+
     result['series'] = {'label': label, 'counts': response['normalized_facets'][0]['counts']}
     result['status'] = 0
     result['message'] = ''
@@ -355,12 +355,12 @@ def get_timeline(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def new_facet(request):  
+def new_facet(request):
   result = {'status': -1, 'message': 'Error'}
-  
+
   try:
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
-    
+
     facet_id = request.POST['id']
     facet_label = request.POST['label']
     facet_field = request.POST['field']
@@ -385,23 +385,23 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     'isDate': False,
     'andUp': False,  # Not used yet
   }
-  
+
   solr_api = SolrApi(SOLR_URL.get(), user)
   range_properties = _new_range_facet(solr_api, collection, facet_field, widget_type)
-                        
+
   if range_properties:
     facet_type = 'range'
-    properties.update(range_properties)       
+    properties.update(range_properties)
   elif widget_type == 'hit-widget':
-    facet_type = 'query'      
+    facet_type = 'query'
   else:
-    facet_type = 'field'        
-      
+    facet_type = 'field'
+
   if widget_type == 'map-widget':
     properties['scope'] = 'world'
     properties['mincount'] = 1
-    properties['limit'] = 100     
-    
+    properties['limit'] = 100
+
   return {
     'id': facet_id,
     'label': facet_label,
@@ -411,23 +411,23 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     'properties': properties
   }
 
-def get_range_facet(request):  
+def get_range_facet(request):
   result = {'status': -1, 'message': ''}
 
   try:
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
     facet = json.loads(request.POST.get('facet', '{}'))
     action = request.POST.get('action', 'select')
-            
+
     solr_api = SolrApi(SOLR_URL.get(), request.user)
 
     if action == 'select':
       properties = _guess_gap(solr_api, collection, facet, facet['properties']['start'], facet['properties']['end'])
     else:
       properties = _zoom_range_facet(solr_api, collection, facet)
-            
+
     result['properties'] = properties
-    result['status'] = 0      
+    result['status'] = 0
 
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
@@ -435,17 +435,17 @@ def get_range_facet(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def get_collection(request):  
+def get_collection(request):
   result = {'status': -1, 'message': ''}
 
   try:
     name = request.POST['name']
-            
+
     collection = Collection(name=name, label=name)
     collection_json = collection.get_c(request.user)
-            
+
     result['collection'] = json.loads(collection_json)
-    result['status'] = 0      
+    result['status'] = 0
 
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
@@ -453,12 +453,12 @@ def get_collection(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
-def get_collections(request):  
+def get_collections(request):
   result = {'status': -1, 'message': ''}
 
-  try:           
+  try:
     result['collection'] = SearchController(request.user).get_all_indexes()
-    result['status'] = 0      
+    result['status'] = 0
 
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")

+ 3 - 3
apps/search/static/help/index.html

@@ -4,14 +4,14 @@
 <p>The Solr Search application, which is based on  <a href="http://lucene.apache.org/solr/">Apache Solr</a>, allows you to perform keyword searches across Hadoop data. A wizard lets you style the result snippets, specify facets to group the results, sort the results, and highlight result fields.</p>
 
                 <h2 class="subhead"><a href="http://gethue.tumblr.com/post/66351828212/new-search-feature-graphical-facets">New Search feature: Graphical facets</a></h2>
-                
-                
+
+
                 <p>
                     <p>This feature lets you search interactively:</p>
 <p><iframe frameborder="0" height="495" src="http://player.vimeo.com/video/78887745" width="900"></iframe></p>
 <p>As usual feel free to comment on the <a href="https://groups.google.com/a/cloudera.org/group/hue-user/">hue-user</a> list or <a href="https://twitter.com/gethue">@gethue</a>!</p>
                 </p>
-                
+
 
 <h2>Solr Search Installation and Configuration</h2>
 

+ 5 - 5
apps/search/static/js/charts.ko.js

@@ -149,7 +149,7 @@ ko.bindingHandlers.mapChart = {
       _fills["defaultFill"] = HueColors.LIGHT_BLUE;
       _fills["selected"] = HueColors.DARK_BLUE;
       $(_data).each(function(cnt, item) {
-    	var _place = item.label.toUpperCase();
+      var _place = item.label.toUpperCase();
         if (_place != null){
           _mapdata[_place] = {
             fillKey: "selected",
@@ -211,10 +211,10 @@ ko.bindingHandlers.mapChart = {
           selectedFillColor: HueColors.DARKER_BLUE,
           selectedBorderColor: HueColors.DARKER_BLUE,
           popupTemplate: function(geography, data) {
-        	var _hover = '';
-        	if (data != null) {
-        	  _hover = '<br/>' + mapHovers[data.id];
-        	}
+          var _hover = '';
+          if (data != null) {
+            _hover = '<br/>' + mapHovers[data.id];
+          }
             return '<div class="hoverinfo" style="text-align: center"><strong>' + geography.properties.name + '</strong>' + _hover + '</div>'
           }
         }

+ 6 - 6
apps/search/static/js/nv.d3.growingMultiBarChart.js

@@ -273,7 +273,7 @@ nv.models.growingMultiBarChart = function() {
               // Issue #140
               xTicks
                 .selectAll("text")
-                .attr('transform', function(d,i,j) { 
+                .attr('transform', function(d,i,j) {
                     return  getTranslate(0, (j % 2 == 0 ? staggerUp : staggerDown));
                   });
 
@@ -297,13 +297,13 @@ nv.models.growingMultiBarChart = function() {
               .selectAll('.tick text')
               .attr('transform', 'rotate(' + rotateLabels + ' 0,0)')
               .style('text-anchor', rotateLabels > 0 ? 'start' : 'end');
-          
+
           g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
               .style('opacity', 1);
       }
 
 
-      if (showYAxis) {      
+      if (showYAxis) {
           yAxis
             .scale(y)
             .ticks( availableHeight / 36 )
@@ -322,7 +322,7 @@ nv.models.growingMultiBarChart = function() {
       // Event Handling/Dispatching (in chart's scope)
       //------------------------------------------------------------
 
-      legend.dispatch.on('stateChange', function(newState) { 
+      legend.dispatch.on('stateChange', function(newState) {
         state = newState;
         dispatch.stateChange(state);
         chart.update();
@@ -420,7 +420,7 @@ nv.models.growingMultiBarChart = function() {
    'id', 'stacked', 'stackOffset', 'delay', 'barColor','groupSpacing');
 
   chart.options = nv.utils.optionsFunc.bind(chart);
-  
+
   chart.margin = function(_) {
     if (!arguments.length) return margin;
     margin.top    = typeof _.top    != 'undefined' ? _.top    : margin.top;
@@ -527,7 +527,7 @@ nv.models.growingMultiBarChart = function() {
     defaultState = _;
     return chart;
   };
-  
+
   chart.noData = function(_) {
     if (!arguments.length) return noData;
     noData = _;

+ 185 - 185
apps/search/static/js/search.ko.js

@@ -104,7 +104,7 @@ var Widget = function (size, id, name, widgetType, properties, offset, loading)
     self.size(self.size() + 1);
     $("#wdg_" + self.id()).trigger("resize");
   }
-  
+
   self.compress = function () {
     self.size(self.size() - 1);
     $("#wdg_" + self.id()).trigger("resize");
@@ -113,7 +113,7 @@ var Widget = function (size, id, name, widgetType, properties, offset, loading)
   self.moveLeft = function () {
     self.offset(self.offset() - 1);
   }
-  
+
   self.moveRight = function () {
     self.offset(self.offset() + 1);
   }
@@ -181,8 +181,8 @@ function setLayout(colSizes) {
 
 function loadLayout(viewModel, json_layout) {
   var _columns = [];
-  
-  $(json_layout).each(function (cnt, json_col) { 
+
+  $(json_layout).each(function (cnt, json_col) {
     var _rows = [];
     $(json_col.rows).each(function (rcnt, json_row) {
       var row = new Row();
@@ -206,10 +206,10 @@ var Query = function (vm, query) {
   self.qs = ko.mapping.fromJS(query.qs);
   self.fqs = ko.mapping.fromJS(query.fqs);
   self.start = ko.mapping.fromJS(query.start);
-  
+
   var defaultMultiqGroup = {'id': 'query', 'label': 'query'};
   self.multiqs = ko.computed(function () { // List of widgets supporting multiqs
-	var histogram_id = vm.collection.getHistogramFacet();
+  var histogram_id = vm.collection.getHistogramFacet();
     return [defaultMultiqGroup].concat(
         $.map($.grep(self.fqs(), function(fq, i) {
             return (fq.type() == 'field' || fq.type() == 'range') && (histogram_id == null || histogram_id.id() != fq.id());
@@ -220,7 +220,7 @@ var Query = function (vm, query) {
 
   self.getFacetFilter = function(widget_id) {
     var _fq = null;
-    $.each(self.fqs(), function (index, fq) { 
+    $.each(self.fqs(), function (index, fq) {
       if (fq.id() == widget_id) {
         _fq = fq;
         return false;
@@ -244,19 +244,19 @@ var Query = function (vm, query) {
     }
     return null;
   });
-  
+
   self.selectedMultiq.subscribe(function () { // To keep below the computed
     vm.search();
   });
-  
+
   self.addQ = function (data) {
     self.qs.push(ko.mapping.fromJS({'q': ''}));
   };
-  
+
   self.removeQ = function (query) {
     self.qs.remove(query);
   };
-  
+
   self.toggleFacet = function (data) {
     var fq = self.getFacetFilter(data.widget_id);
 
@@ -281,17 +281,17 @@ var Query = function (vm, query) {
         }
       });
     }
-  
+
     vm.search();
-  }  
-  
+  }
+
   self.selectRangeFacet = function (data) {
     if (data.force != undefined) {
       self.removeFilter(ko.mapping.fromJS({'id': data.widget_id}));
     }
-    
-	var fq = self.getFacetFilter(data.widget_id);
-	  
+
+  var fq = self.getFacetFilter(data.widget_id);
+  
     if (fq == null) {
       self.fqs.push(ko.mapping.fromJS({
           'id': data.widget_id,
@@ -299,21 +299,21 @@ var Query = function (vm, query) {
           'filter': [data.from],
           'properties': [{'from': data.from, 'to': data.to}],
           'type': 'range'
-      }));    	
-    } else {    
+      }));      
+    } else {
       if (fq.filter().indexOf(data.from) > -1) { // Unselect
-    	fq.filter.remove(data.from);
-    	$.each(fq.properties(), function (index, prop) {
-    	  if (prop && prop.from() == data.from) {
-    	    fq.properties.remove(prop);
-    	  }
-    	});
-    	if (fq.filter().length == 0) {
+      fq.filter.remove(data.from);
+      $.each(fq.properties(), function (index, prop) {
+        if (prop && prop.from() == data.from) {
+          fq.properties.remove(prop);
+        }
+      });
+      if (fq.filter().length == 0) {
           self.removeFilter(ko.mapping.fromJS({'id': data.widget_id}));
-    	}    	 
+      }      
       } else {
-    	 fq.filter.push(data.from);
-    	 fq.properties.push(ko.mapping.fromJS({'from': data.from, 'to': data.to}));
+       fq.filter.push(data.from);
+       fq.properties.push(ko.mapping.fromJS({'from': data.from, 'to': data.to}));
       }
     }
 
@@ -321,28 +321,28 @@ var Query = function (vm, query) {
       vm.search();
     }
   };
-  
-  self.removeFilter = function (data) { 
+
+  self.removeFilter = function (data) {
     $.each(self.fqs(), function (index, fq) {
-      if (fq.id() == data.id()) {          
+      if (fq.id() == data.id()) {
         self.fqs.remove(fq);
         // Also re-init range select widget
         var rangeWidget = vm.collection.getFacetById(fq.id());
         if (rangeWidget != null && RANGE_SELECTABLE_WIDGETS.indexOf(rangeWidget.widgetType()) != -1 && fq.type() == 'range') {
-          vm.collection.timeLineZoom({'id': rangeWidget.id()});	
+          vm.collection.timeLineZoom({'id': rangeWidget.id()});  
         }
         return false;
       }
     });
-  }; 
-  
+  };
+
   self.paginate = function (direction) {
-	if (direction == 'next') {
-	  self.start(self.start() + vm.collection.template.rows() * 1.0);
-	} else {
-	  self.start(self.start() - vm.collection.template.rows() * 1.0);
-	}
-	vm.search();
+  if (direction == 'next') {
+    self.start(self.start() + vm.collection.template.rows() * 1.0);
+  } else {
+    self.start(self.start() - vm.collection.template.rows() * 1.0);
+  }
+  vm.search();
   };
 };
 
@@ -403,7 +403,7 @@ var Collection = function (vm, collection) {
     });
   });
   self.template.rows.subscribe(function(){
-	vm.search();
+  vm.search();
   });
   self.template.rows.extend({rateLimit: {timeout: 1500, method: "notifyWhenChangesStop"}});
 
@@ -411,7 +411,7 @@ var Collection = function (vm, collection) {
 
   self.availableFacetFields = ko.computed(function() {
     var facetFieldNames = $.map(self.facets(), function(facet) {
-	  return facet.field(); //filter out text_general, __version__
+    return facet.field(); //filter out text_general, __version__
     });
     return $.grep(self.fields(), function(field) {
       return facetFieldNames.indexOf(field.name()) == -1;
@@ -422,7 +422,7 @@ var Collection = function (vm, collection) {
 
   self.addFacet = function (facet_json) {
     self.removeFacet(function(){return facet_json.widget_id});
-	  
+  
     $.post("/search/template/new_facet", {
       "collection": ko.mapping.toJSON(self),
         "id": facet_json.widget_id,
@@ -434,7 +434,7 @@ var Collection = function (vm, collection) {
           var facet = ko.mapping.fromJS(data.facet);
           facet.field.subscribe(function() {
             vm.search();
-          });      
+          });
           self.facets.push(facet);
           vm.search();
         } else {
@@ -446,12 +446,12 @@ var Collection = function (vm, collection) {
   self.removeFacet = function (widget_id) {
     $.each(self.facets(), function (index, facet) {
       if (facet.id() == widget_id()) {
-        self.facets.remove(facet); 
+        self.facets.remove(facet);
         return false;
       }
     });
-  }  
-  
+  }
+
   self.getFacetById = function (facet_id) {
     var _facet = null;
     $.each(self.facets(), function (index, facet) {
@@ -473,18 +473,18 @@ var Collection = function (vm, collection) {
     });
     return _facet;
   }
-  
+
   self.getHistogramFacet = function () { // Should do multi histogram
     return self.getFacetByType('histogram-widget');
   }
-  
+
   self.template.fields = ko.computed(function () {
     var _fields = [];
     $.each(self.template.fieldsAttributes(), function (index, field) {
       var position = self.template.fieldsSelected.indexOf(field.name());
       if (position != -1) {
         _fields[position] = field;
-      }      
+      }
     });
     return _fields;
   });
@@ -497,7 +497,7 @@ var Collection = function (vm, collection) {
         return false;
       }
     });
-    return _field;    
+    return _field;
   };
 
   self.template.fieldsModalFilter = ko.observable(""); // For UI
@@ -523,7 +523,7 @@ var Collection = function (vm, collection) {
   });
   self.template.availableWidgetFields = ko.computed(function() {
     if (self.template.fieldsModalType() == 'histogram-widget') {
-      return vm.availableDateFields();	
+      return vm.availableDateFields();  
     }
     else if (self.template.fieldsModalType() == 'line-widget') {
       return vm.availableNumberFields();
@@ -533,11 +533,11 @@ var Collection = function (vm, collection) {
     }
   });
   self.template.availableWidgetFieldsNames = ko.computed(function() {
-	return $.map(self.template.availableWidgetFields(), function(field){
-	  return field.name();
-	});
+  return $.map(self.template.availableWidgetFields(), function(field){
+    return field.name();
   });
-  
+  });
+
   self.template.fieldsModalFilter.subscribe(function(value) {
     var _fields = [];
     var _availableFields = self.template.availableWidgetFields();
@@ -553,43 +553,43 @@ var Collection = function (vm, collection) {
   self.switchCollection = function() { // Long term would be to reload the page
     $.post("/search/get_collection", {
         name: self.name()
-	  }, function (data) {
-	    if (data.status == 0) {
-	      self.idField(data.collection.collection.idField);	      
-	      self.template.template(data.collection.collection.template.template);
-	      self.template.fieldsAttributes.removeAll();
-	      $.each(data.collection.collection.template.fieldsAttributes, function(index, field) {
-		    self.template.fieldsAttributes.push(ko.mapping.fromJS(field));
-		  });	      
-	      self.fields.removeAll();
-	      $.each(data.collection.collection.fields, function(index, field) {
-	    	self.fields.push(ko.mapping.fromJS(field));
-	      });
-	    }
-	}).fail(function (xhr, textStatus, errorThrown) {});
+    }, function (data) {
+      if (data.status == 0) {
+        self.idField(data.collection.collection.idField);  
+        self.template.template(data.collection.collection.template.template);
+        self.template.fieldsAttributes.removeAll();
+        $.each(data.collection.collection.template.fieldsAttributes, function(index, field) {
+        self.template.fieldsAttributes.push(ko.mapping.fromJS(field));
+      });  
+        self.fields.removeAll();
+        $.each(data.collection.collection.fields, function(index, field) {
+        self.fields.push(ko.mapping.fromJS(field));
+        });
+      }
+  }).fail(function (xhr, textStatus, errorThrown) {});
   };
-  
+
   function diff(A, B) {
-	return A.filter(function (a) {
-	  return B.indexOf(a) == -1;
-	});
+  return A.filter(function (a) {
+    return B.indexOf(a) == -1;
+  });
   }
 
   function syncArray(currentObservable, newJson, isDynamic) {
     // Get names of fields
     var _currentFieldsNames = $.map(
         $.grep(currentObservable(), function(field) {
-    	    return field.isDynamic() == isDynamic;
-    	  }), function(field) {
-    	return field.name(); 
+          return field.isDynamic() == isDynamic;
+        }), function(field) {
+      return field.name();
     });
     var _newFieldsNames = $.map(
-    	$.grep(newJson, function(field) {
-    	  return field.isDynamic == isDynamic;
+      $.grep(newJson, function(field) {
+        return field.isDynamic == isDynamic;
         }), function(field) {
-    	return field.name;
+      return field.name;
     });
-      
+
     var _toDelete = diff(_currentFieldsNames, _newFieldsNames);
     var _toAdd = diff(_newFieldsNames, _currentFieldsNames);
 
@@ -601,33 +601,33 @@ var Collection = function (vm, collection) {
     });
     // New fields
     $.each(newJson, function(index, field) {
-  	 if (_toAdd.indexOf(field.name) != -1) {
+     if (_toAdd.indexOf(field.name) != -1) {
         currentObservable.push(ko.mapping.fromJS(field));
       }
     });
-  }  
-  
+  }
+
   self.syncFields = function() {
     $.post("/search/get_collection", {
         name: self.name()
-	  }, function (data) {
-	    if (data.status == 0) {
-	      self.idField(data.collection.collection.idField);   
-	      syncArray(self.template.fieldsAttributes, data.collection.collection.template.fieldsAttributes, false);	      
-	      syncArray(self.fields, data.collection.collection.fields, false);
-	    }
-	    // After sync the dynamic fields
-	    self.syncDynamicFields()
-	}).fail(function (xhr, textStatus, errorThrown) {});
+    }, function (data) {
+      if (data.status == 0) {
+        self.idField(data.collection.collection.idField);
+        syncArray(self.template.fieldsAttributes, data.collection.collection.template.fieldsAttributes, false);  
+        syncArray(self.fields, data.collection.collection.fields, false);
+      }
+      // After sync the dynamic fields
+      self.syncDynamicFields()
+  }).fail(function (xhr, textStatus, errorThrown) {});
   };
-  
+
   self.syncDynamicFields = function () {
     $.post("/search/index/fields/dynamic", {
-    	name: self.name()
+      name: self.name()
       }, function (data) {
         if (data.status == 0) {
-  	      syncArray(self.template.fieldsAttributes, data.gridlayout_header_fields, true);	      
-	      syncArray(self.fields, data.fields, true);
+          syncArray(self.template.fieldsAttributes, data.gridlayout_header_fields, true);  
+        syncArray(self.fields, data.fields, true);
         }
     }).fail(function (xhr, textStatus, errorThrown) {});
   };
@@ -638,47 +638,47 @@ var Collection = function (vm, collection) {
     } else if (template_field.sort.direction() == 'desc') {
       template_field.sort.direction('asc');
     } else {
-      template_field.sort.direction(null); 
+      template_field.sort.direction(null);
     }
     $(document).trigger("setResultsHeight");
     vm.search();
   };
-  
+
   self.toggleSortFacet = function (facet_field, event) {
     if (facet_field.properties.sort() == 'desc') {
       facet_field.properties.sort('asc');
     } else {
       facet_field.properties.sort('desc');
-    }   
-   
+    }
+
     $(event.target).button('loading');
     vm.search();
   };
 
   self.toggleRangeFacet = function (facet_field, event) {
     vm.query.removeFilter(ko.mapping.fromJS({'id': facet_field.id})); // Reset filter query
- 
+
     if (facet_field.type() == 'field') {
        facet_field.type('range');
      } else if (facet_field.type() == 'range') {
        facet_field.type('field')
      }
-   
+
     $(event.target).button('loading');
     vm.search();
-  };  
+  };
 
-  self.selectTimelineFacet = function (data) { // alert(ko.mapping.toJSON(data)); 
+  self.selectTimelineFacet = function (data) { // alert(ko.mapping.toJSON(data));
     var facet = self.getFacetById(data.widget_id);
-  
+
     facet.properties.start(data.from);
     facet.properties.end(data.to);
-  
+
     vm.query.selectRangeFacet({widget_id: data.widget_id, from: data.from, to: data.to, cat: data.cat, no_refresh: true, force: true});
-  
+
     $.ajax({
       type: "POST",
-      url: "/search/get_range_facet",    
+      url: "/search/get_range_facet",
       data: {
         collection: ko.mapping.toJSON(self),
         facet: ko.mapping.toJSON(facet),
@@ -690,20 +690,20 @@ var Collection = function (vm, collection) {
         }
       },
       async: false
-    });  
-  
+    });
+
     vm.search();
   }
 
-  self.timeLineZoom = function (facet_json) { 
+  self.timeLineZoom = function (facet_json) {
     var facet = self.getFacetById(facet_json.id);
 
     facet.properties.start(facet.from);
     facet.properties.end(facet.to);
-  
+
     $.ajax({
       type: "POST",
-      url: "/search/get_range_facet",    
+      url: "/search/get_range_facet",
       data: {
         collection: ko.mapping.toJSON(self),
         facet: ko.mapping.toJSON(facet),
@@ -714,7 +714,7 @@ var Collection = function (vm, collection) {
           facet.properties.start(data.properties.start);
           facet.properties.end(data.properties.end);
           facet.properties.gap(data.properties.gap);
-          
+
           var fq = vm.query.getFacetFilter(facet_json.id);
           if (fq != null) {
             fq.properties()[0].from(data.properties.start);
@@ -723,11 +723,11 @@ var Collection = function (vm, collection) {
         }
       },
       async: false
-    });  
-  
+    });
+
     vm.search();
   }
-  
+
   self.translateSelectedField = function (index, direction) {
     var array = self.template.fieldsSelected();
 
@@ -737,20 +737,20 @@ var Collection = function (vm, collection) {
       self.template.fieldsSelected.splice(index, 2, array[index + 1], array[index]);
     }
   };
-  
+
   self.upDownFacetLimit = function (facet_id, direction) {
     var facet = self.getFacetById(facet_id);
-    
+
     if (facet.properties.prevLimit == undefined) {
       facet.properties.prevLimit = facet.properties.limit();
     }
-    
+
     if (direction == 'up') {
       facet.properties.limit(facet.properties.limit() + 10);
     } else {
       facet.properties.limit(facet.properties.limit() - 10);
     }
-    
+
     vm.search();
   };
 };
@@ -761,29 +761,29 @@ var NewTemplate = function (vm, initial) {
   self.collections = ko.mapping.fromJS(initial.collections);
   self.layout = initial.layout;
   self.inited = ko.observable(self.collections().length > 0); // No collection if not a new dashboard
-  
-  self.init = function() { 
-	if (self.inited()) {
-	  // If new dashboard
-	  vm.collection.name.subscribe(function(newValue) {
-		vm.collection.label(newValue);
-	    vm.collection.switchCollection();
-		vm.search();
-	  });
-	} else {
-	  self.syncCollections();
-	}	  
-	  
+
+  self.init = function() {
+    if (self.inited()) {
+      // If new dashboard
+      vm.collection.name.subscribe(function(newValue) {
+      vm.collection.label(newValue);
+      vm.collection.switchCollection();
+      vm.search();
+      });
+    } else {
+      self.syncCollections();
+    }  
+
     if (initial.autoLoad) {
-	  magicLayout(vm);
-    }   
+      magicLayout(vm);
+    }
   };
-  
+
   self.syncCollections = function () {
     $.post("/search/get_collections", {
     },function (data) {
       if (data.status == 0) {
-    	// Sync new and old names
+      // Sync new and old names
         $.each(data.collection, function(index, name) {
           if (self.collections.indexOf(name) == -1) {
             self.collections.push(name);
@@ -793,8 +793,8 @@ var NewTemplate = function (vm, initial) {
           if (data.collection.indexOf(collection) == -1) {
             self.collections.remove(collection);
           }
-        });        
-      } 
+        });
+      }
       else {
         $(document).trigger("error", data.message);
       }
@@ -803,7 +803,7 @@ var NewTemplate = function (vm, initial) {
     }).done(function() {
       self.inited(true);
     });
-  };   
+  };
 };
 
 
@@ -827,16 +827,16 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.norm_facets = ko.computed(function () {
     return self.response().normalized_facets;
   });
-  self.getFacetFromQuery = function (facet_id) {  
+  self.getFacetFromQuery = function (facet_id) {
     var _facet = null;
     if (self.norm_facets() !== undefined) {
-      $.each(self.norm_facets(), function (index, norm_facet) {  
+      $.each(self.norm_facets(), function (index, norm_facet) {
         if (norm_facet.id == facet_id) {
           _facet = norm_facet;
-        }      
+        }
       });
     }
-    return _facet;    
+    return _facet;
   };
   self.toggledGridlayoutResultChevron = ko.observable(false);
   self.enableGridlayoutResultChevron = function() {
@@ -855,7 +855,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     self.isEditing(!self.isEditing());
   };
   self.isRetrievingResults = ko.observable(false);
-      
+
   self.draggableHit = ko.observable(new Widget(12, UUID(), "Hit Count", "hit-widget"));
   self.draggableFacet = ko.observable(new Widget(12, UUID(), "Facet", "facet-widget"));
   self.draggableResultset = ko.observable(new Widget(12, UUID(), "Grid Results", "resultset-widget"));
@@ -865,7 +865,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.draggableMap = ko.observable(new Widget(12, UUID(), "Map", "map-widget"));
   self.draggableLine = ko.observable(new Widget(12, UUID(), "Line Chart", "line-widget"));
   self.draggablePie = ko.observable(new Widget(12, UUID(), "Pie Chart", "pie-widget"));
-  self.draggableFilter = ko.observable(new Widget(12, UUID(), "Filter Bar", "filter-widget"));  
+  self.draggableFilter = ko.observable(new Widget(12, UUID(), "Filter Bar", "filter-widget"));
 
   self.availableDateFields = ko.computed(function() {
     return $.grep(self.collection.availableFacetFields(), function(field) { return DATE_TYPES.indexOf(field.type()) != -1; });
@@ -873,35 +873,35 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.availableNumberFields = ko.computed(function() {
     return $.grep(self.collection.availableFacetFields(), function(field) { return NUMBER_TYPES.indexOf(field.type()) != -1; });
   });
-  
+
   function getWidgets(equalsTo) {
-	return $.map(self.columns(), function (col){return $.map(col.rows(), function(row){ return $.grep(row.widgets(), function(widget){ return equalsTo(widget); });}) ;})
+    return $.map(self.columns(), function (col){return $.map(col.rows(), function(row){ return $.grep(row.widgets(), function(widget){ return equalsTo(widget); });}) ;})
   };
-  
+
   self.availableDraggableResultset = ko.computed(function() {
-	return getWidgets(function(widget){ return ['resultset-widget', 'html-resultset-widget'].indexOf(widget.widgetType()) != -1; }).length == 0;
+    return getWidgets(function(widget){ return ['resultset-widget', 'html-resultset-widget'].indexOf(widget.widgetType()) != -1; }).length == 0;
   });
   self.availableDraggableFilter = ko.computed(function() {
-	return getWidgets(function(widget){ return widget.widgetType() == 'filter-widget'; }).length == 0;
-  });  
+    return getWidgets(function(widget){ return widget.widgetType() == 'filter-widget'; }).length == 0;
+  });
   self.availableDraggableHistogram = ko.computed(function() {
-	return getWidgets(function(widget){ return widget.widgetType() == 'histogram-widget'; }).length == 0 &&
-	  self.availableDateFields().length > 0;
+    return getWidgets(function(widget){ return widget.widgetType() == 'histogram-widget'; }).length == 0 &&
+    self.availableDateFields().length > 0;
   });
   self.availableDraggableNumbers = ko.computed(function() {
-	return getWidgets(function(widget){ return widget.widgetType() == 'line-widget'; }).length == 0 &&
-	  self.availableNumberFields().length > 0;
+    return getWidgets(function(widget){ return widget.widgetType() == 'line-widget'; }).length == 0 &&
+    self.availableNumberFields().length > 0;
   });
   self.availableDraggableChart = ko.computed(function() {
     return self.collection.availableFacetFields().length > 0;
   });
-  
+
   self.init = function (callback) {
-	self.initial.init();
-	self.collection.syncFields();
+  self.initial.init();
+  self.collection.syncFields();
     self.search(callback);
   }
-  
+
   self.searchBtn = function () {
     self.query.start(0);
     self.search();
@@ -910,22 +910,22 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.search = function (callback) {
     self.isRetrievingResults(true);
     $(".jHueNotify").hide();
-    
-    // Multi queries    
+
+    // Multi queries
     var multiQs = [];
     var multiQ = self.query.getMultiq();
-    
+
     if (multiQ != null) {
       var facet = {};
       var queries = [];
-      
+
       if (multiQ == 'query') {
         queries = self.query.qs();
       } else {
         facet = self.query.getFacetFilter(self.query.selectedMultiq());
-        queries = facet.filter();       
+        queries = facet.filter();
       }
-      
+
       multiQs = $.map(queries, function(qdata) {
         return $.post("/search/get_timeline", {
             collection: ko.mapping.toJSON(self.collection),
@@ -934,7 +934,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
             qdata: ko.mapping.toJSON(qdata),
             multiQ: multiQ
           }, function (data) {return data});
-      });              
+      });
     }
 
     $.when.apply($, [
@@ -959,17 +959,17 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
               var fields = self.collection.template.fieldsSelected();
               // Display selected fields or whole json document
               if (fields.length != 0) {
-                $.each(self.collection.template.fieldsSelected(), function (index, field) {  
+                $.each(self.collection.template.fieldsSelected(), function (index, field) {
                   row.push(item[field]);
                 });
               } else {
-                row.push(ko.mapping.toJSON(item)); 
+                row.push(ko.mapping.toJSON(item));
               }
               var doc = {
-            	  'id': item[self.collection.idField()],
-            	  'row': row,
-            	  'showDetails': ko.observable(item.showDetails),
-            	  'details': ko.observableArray(item.details),
+                'id': item[self.collection.idField()],
+                'row': row,
+                'showDetails': ko.observable(item.showDetails),
+                'details': ko.observableArray(item.details),
               };
               self.results.push(doc);
             });
@@ -991,7 +991,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     .done(function() {
       if (arguments[0] instanceof Array) { // If multi queries
         var histoFacetId = self.collection.getHistogramFacet().id();
-        var histoFacet = self.getFacetFromQuery(histoFacetId);  
+        var histoFacet = self.getFacetFromQuery(histoFacetId);
         for (var i = 1; i < arguments.length; i++) {
           histoFacet.extraSeries.push(arguments[i][0]['series']);
         }
@@ -1046,12 +1046,12 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       id: doc.id
     }, function (data) {
       if (data.status == 0) {
-	    $.each(data.doc.doc, function(key, val) {
-	      doc['details'].push(ko.mapping.fromJS({
-		      key: key,
-		      value: val
-		  }));	    		    	
-	    });
+      $.each(data.doc.doc, function(key, val) {
+        doc['details'].push(ko.mapping.fromJS({
+          key: key,
+          value: val
+      }));                
+      });
       }
       else if (data.status == 1) {
         $(document).trigger("info", data.message);
@@ -1062,8 +1062,8 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     }).fail(function (xhr, textStatus, errorThrown) {
       $(document).trigger("error", xhr.responseText);
     });
-  };  
-  
+  };
+
 
   self.save = function () {
     $.post("/search/save", {

+ 1 - 1
apps/search/static/js/search.utils.js

@@ -154,7 +154,7 @@ function fixTemplateDotsAndFunctionNames(template) {
       }
       if (tag.indexOf(".") > -1) {
         _mustacheTmpl = _mustacheTmpl.replace(tag, tag.replace(/\./gi, "_"))
-      }      
+      }
     });
     _mustacheTmpl = _mustacheTmpl.replace(/\{\{(.+?)\}\}/g, "{{{$1}}}");
   }

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/admin-extra.html

@@ -16,7 +16,7 @@
 -->
 
 <!-- The content of this page will be statically included into the top-
-right box of the cores overview page. Uncomment this as an example to 
+right box of the cores overview page. Uncomment this as an example to
 see there the content will show up.
 
 <img src="img/ico/construction.png"> This line will appear at the top-

+ 4 - 4
desktop/libs/indexer/src/data/solr_configs/conf/currency.xml

@@ -58,10 +58,10 @@
     <rate from="USD" to="AED" rate="3.672955" comment="U.A.E. Dirham" />
     <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
     <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
-    
+
     <!-- Cross-rates for some common currencies -->
-    <rate from="EUR" to="GBP" rate="0.869914" />  
-    <rate from="EUR" to="NOK" rate="7.800095" />  
-    <rate from="GBP" to="NOK" rate="8.966508" />  
+    <rate from="EUR" to="GBP" rate="0.869914" />
+    <rate from="EUR" to="NOK" rate="7.800095" />
+    <rate from="GBP" to="NOK" rate="8.966508" />
   </rates>
 </currencyConfig>

+ 2 - 2
desktop/libs/indexer/src/data/solr_configs/conf/elevate.xml

@@ -29,10 +29,10 @@
   <doc id="2" />
   <doc id="3" />
  </query>
- 
+
  <query text="ipod">
    <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
    <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
  </query>
- 
+
 </elevate>

+ 19 - 19
desktop/libs/indexer/src/data/solr_configs/conf/lang/contractions_it.txt

@@ -1,23 +1,23 @@
 # Set of Italian contractions for ElisionFilter
 # TODO: load this as a resource from the analyzer and sync it in build.xml
 c
-l 
-all 
-dall 
-dell 
-nell 
-sull 
-coll 
-pell 
-gl 
-agl 
-dagl 
-degl 
-negl 
-sugl 
-un 
-m 
-t 
-s 
-v 
+l
+all
+dall
+dell
+nell
+sull
+coll
+pell
+gl
+agl
+dagl
+degl
+negl
+sugl
+un
+m
+t
+s
+v
 d

+ 55 - 55
desktop/libs/indexer/src/data/solr_configs/conf/lang/stoptags_ja.txt

@@ -17,7 +17,7 @@
 #  noun-common: Common nouns or nouns where the sub-classification is undefined
 #名詞-一般
 #
-#  noun-proper: Proper nouns where the sub-classification is undefined 
+#  noun-proper: Proper nouns where the sub-classification is undefined
 #名詞-固有名詞
 #
 #  noun-proper-misc: miscellaneous proper nouns
@@ -26,7 +26,7 @@
 #  noun-proper-person: Personal names where the sub-classification is undefined
 #名詞-固有名詞-人名
 #
-#  noun-proper-person-misc: names that cannot be divided into surname and 
+#  noun-proper-person-misc: names that cannot be divided into surname and
 #  given name; foreign names; names where the surname or given name is unknown.
 #  e.g. お市の方
 #名詞-固有名詞-人名-一般
@@ -50,28 +50,28 @@
 #  e.g. アジア, バルセロナ, 京都
 #名詞-固有名詞-地域-一般
 #
-#  noun-proper-place-country: Country names. 
+#  noun-proper-place-country: Country names.
 #  e.g. 日本, オーストラリア
 #名詞-固有名詞-地域-国
 #
 #  noun-pronoun: Pronouns where the sub-classification is undefined
 #名詞-代名詞
 #
-#  noun-pronoun-misc: miscellaneous pronouns: 
+#  noun-pronoun-misc: miscellaneous pronouns:
 #  e.g. それ, ここ, あいつ, あなた, あちこち, いくつ, どこか, なに, みなさん, みんな, わたくし, われわれ
 #名詞-代名詞-一般
 #
-#  noun-pronoun-contraction: Spoken language contraction made by combining a 
+#  noun-pronoun-contraction: Spoken language contraction made by combining a
 #  pronoun and the particle 'wa'.
-#  e.g. ありゃ, こりゃ, こりゃあ, そりゃ, そりゃあ 
+#  e.g. ありゃ, こりゃ, こりゃあ, そりゃ, そりゃあ
 #名詞-代名詞-縮約
 #
-#  noun-adverbial: Temporal nouns such as names of days or months that behave 
+#  noun-adverbial: Temporal nouns such as names of days or months that behave
 #  like adverbs. Nouns that represent amount or ratios and can be used adverbially,
 #  e.g. 金曜, 一月, 午後, 少量
 #名詞-副詞可能
 #
-#  noun-verbal: Nouns that take arguments with case and can appear followed by 
+#  noun-verbal: Nouns that take arguments with case and can appear followed by
 #  'suru' and related verbs (する, できる, なさる, くださる)
 #  e.g. インプット, 愛着, 悪化, 悪戦苦闘, 一安心, 下取り
 #名詞-サ変接続
@@ -87,28 +87,28 @@
 #  noun-affix: noun affixes where the sub-classification is undefined
 #名詞-非自立
 #
-#  noun-affix-misc: Of adnominalizers, the case-marker の ("no"), and words that 
-#  attach to the base form of inflectional words, words that cannot be classified 
+#  noun-affix-misc: Of adnominalizers, the case-marker の ("no"), and words that
+#  attach to the base form of inflectional words, words that cannot be classified
 #  into any of the other categories below. This category includes indefinite nouns.
-#  e.g. あかつき, 暁, かい, 甲斐, 気, きらい, 嫌い, くせ, 癖, こと, 事, ごと, 毎, しだい, 次第, 
-#       順, せい, 所為, ついで, 序で, つもり, 積もり, 点, どころ, の, はず, 筈, はずみ, 弾み, 
+#  e.g. あかつき, 暁, かい, 甲斐, 気, きらい, 嫌い, くせ, 癖, こと, 事, ごと, 毎, しだい, 次第,
+#       順, せい, 所為, ついで, 序で, つもり, 積もり, 点, どころ, の, はず, 筈, はずみ, 弾み,
 #       拍子, ふう, ふり, 振り, ほう, 方, 旨, もの, 物, 者, ゆえ, 故, ゆえん, 所以, わけ, 訳,
 #       わり, 割り, 割, ん-口語/, もん-口語/
 #名詞-非自立-一般
 #
 #  noun-affix-adverbial: noun affixes that that can behave as adverbs.
-#  e.g. あいだ, 間, あげく, 挙げ句, あと, 後, 余り, 以外, 以降, 以後, 以上, 以前, 一方, うえ, 
-#       上, うち, 内, おり, 折り, かぎり, 限り, きり, っきり, 結果, ころ, 頃, さい, 際, 最中, さなか, 
-#       最中, じたい, 自体, たび, 度, ため, 為, つど, 都度, とおり, 通り, とき, 時, ところ, 所, 
-#       とたん, 途端, なか, 中, のち, 後, ばあい, 場合, 日, ぶん, 分, ほか, 他, まえ, 前, まま, 
+#  e.g. あいだ, 間, あげく, 挙げ句, あと, 後, 余り, 以外, 以降, 以後, 以上, 以前, 一方, うえ,
+#       上, うち, 内, おり, 折り, かぎり, 限り, きり, っきり, 結果, ころ, 頃, さい, 際, 最中, さなか,
+#       最中, じたい, 自体, たび, 度, ため, 為, つど, 都度, とおり, 通り, とき, 時, ところ, 所,
+#       とたん, 途端, なか, 中, のち, 後, ばあい, 場合, 日, ぶん, 分, ほか, 他, まえ, 前, まま,
 #       儘, 侭, みぎり, 矢先
 #名詞-非自立-副詞可能
 #
-#  noun-affix-aux: noun affixes treated as 助動詞 ("auxiliary verb") in school grammars 
+#  noun-affix-aux: noun affixes treated as 助動詞 ("auxiliary verb") in school grammars
 #  with the stem よう(だ) ("you(da)").
 #  e.g.  よう, やう, 様 (よう)
 #名詞-非自立-助動詞語幹
-#  
+#
 #  noun-affix-adjective-base: noun affixes that can connect to the indeclinable
 #  connection form な (aux "da").
 #  e.g. みたい, ふう
@@ -117,8 +117,8 @@
 #  noun-special: special nouns where the sub-classification is undefined.
 #名詞-特殊
 #
-#  noun-special-aux: The そうだ ("souda") stem form that is used for reporting news, is 
-#  treated as 助動詞 ("auxiliary verb") in school grammars, and attach to the base 
+#  noun-special-aux: The そうだ ("souda") stem form that is used for reporting news, is
+#  treated as 助動詞 ("auxiliary verb") in school grammars, and attach to the base
 #  form of inflectional words.
 #  e.g. そう
 #名詞-特殊-助動詞語幹
@@ -126,9 +126,9 @@
 #  noun-suffix: noun suffixes where the sub-classification is undefined.
 #名詞-接尾
 #
-#  noun-suffix-misc: Of the nouns or stem forms of other parts of speech that connect 
+#  noun-suffix-misc: Of the nouns or stem forms of other parts of speech that connect
 #  to ガル or タイ and can combine into compound nouns, words that cannot be classified into
-#  any of the other categories below. In general, this category is more inclusive than 
+#  any of the other categories below. In general, this category is more inclusive than
 #  接尾語 ("suffix") and is usually the last element in a compound noun.
 #  e.g. おき, かた, 方, 甲斐 (がい), がかり, ぎみ, 気味, ぐるみ, (~した) さ, 次第, 済 (ず) み,
 #       よう, (でき)っこ, 感, 観, 性, 学, 類, 面, 用
@@ -139,23 +139,23 @@
 #  e.g. 君, 様, 著
 #名詞-接尾-人名
 #
-#  noun-suffix-place: Suffixes that form nouns and attach to place names more often 
+#  noun-suffix-place: Suffixes that form nouns and attach to place names more often
 #  than other nouns.
 #  e.g. 町, 市, 県
 #名詞-接尾-地域
 #
-#  noun-suffix-verbal: Of the suffixes that attach to nouns and form nouns, those that 
+#  noun-suffix-verbal: Of the suffixes that attach to nouns and form nouns, those that
 #  can appear before スル ("suru").
 #  e.g. 化, 視, 分け, 入り, 落ち, 買い
 #名詞-接尾-サ変接続
 #
-#  noun-suffix-aux: The stem form of そうだ (様態) that is used to indicate conditions, 
-#  is treated as 助動詞 ("auxiliary verb") in school grammars, and attach to the 
+#  noun-suffix-aux: The stem form of そうだ (様態) that is used to indicate conditions,
+#  is treated as 助動詞 ("auxiliary verb") in school grammars, and attach to the
 #  conjunctive form of inflectional words.
 #  e.g. そう
 #名詞-接尾-助動詞語幹
 #
-#  noun-suffix-adjective-base: Suffixes that attach to other nouns or the conjunctive 
+#  noun-suffix-adjective-base: Suffixes that attach to other nouns or the conjunctive
 #  form of inflectional words and appear before the copula だ ("da").
 #  e.g. 的, げ, がち
 #名詞-接尾-形容動詞語幹
@@ -164,8 +164,8 @@
 #  e.g. 後 (ご), 以後, 以降, 以前, 前後, 中, 末, 上, 時 (じ)
 #名詞-接尾-副詞可能
 #
-#  noun-suffix-classifier: Suffixes that attach to numbers and form nouns. This category 
-#  is more inclusive than 助数詞 ("classifier") and includes common nouns that attach 
+#  noun-suffix-classifier: Suffixes that attach to numbers and form nouns. This category
+#  is more inclusive than 助数詞 ("classifier") and includes common nouns that attach
 #  to numbers.
 #  e.g. 個, つ, 本, 冊, パーセント, cm, kg, カ月, か国, 区画, 時間, 時半
 #名詞-接尾-助数詞
@@ -174,18 +174,18 @@
 #  e.g. (楽し) さ, (考え) 方
 #名詞-接尾-特殊
 #
-#  noun-suffix-conjunctive: Nouns that behave like conjunctions and join two words 
+#  noun-suffix-conjunctive: Nouns that behave like conjunctions and join two words
 #  together.
 #  e.g. (日本) 対 (アメリカ), 対 (アメリカ), (3) 対 (5), (女優) 兼 (主婦)
 #名詞-接続詞的
 #
-#  noun-verbal_aux: Nouns that attach to the conjunctive particle て ("te") and are 
+#  noun-verbal_aux: Nouns that attach to the conjunctive particle て ("te") and are
 #  semantically verb-like.
 #  e.g. ごらん, ご覧, 御覧, 頂戴
 #名詞-動詞非自立的
 #
-#  noun-quotation: text that cannot be segmented into words, proverbs, Chinese poetry, 
-#  dialects, English, etc. Currently, the only entry for 名詞 引用文字列 ("noun quotation") 
+#  noun-quotation: text that cannot be segmented into words, proverbs, Chinese poetry,
+#  dialects, English, etc. Currently, the only entry for 名詞 引用文字列 ("noun quotation")
 #  is いわく ("iwaku").
 #名詞-引用文字列
 #
@@ -198,7 +198,7 @@
 #  prefix: unclassified prefixes
 #接頭詞
 #
-#  prefix-nominal: Prefixes that attach to nouns (including adjective stem forms) 
+#  prefix-nominal: Prefixes that attach to nouns (including adjective stem forms)
 #  excluding numerical expressions.
 #  e.g. お (水), 某 (氏), 同 (社), 故 (~氏), 高 (品質), お (見事), ご (立派)
 #接頭詞-名詞接続
@@ -246,20 +246,20 @@
 #  adverb: unclassified adverbs
 #副詞
 #
-#  adverb-misc: Words that can be segmented into one unit and where adnominal 
+#  adverb-misc: Words that can be segmented into one unit and where adnominal
 #  modification is not possible.
 #  e.g. あいかわらず, 多分
 #副詞-一般
 #
-#  adverb-particle_conjunction: Adverbs that can be followed by の, は, に, 
+#  adverb-particle_conjunction: Adverbs that can be followed by の, は, に,
 #  な, する, だ, etc.
 #  e.g. こんなに, そんなに, あんなに, なにか, なんでも
 #副詞-助詞類接続
 #
 #####
 #  adnominal: Words that only have noun-modifying forms.
-#  e.g. この, その, あの, どの, いわゆる, なんらかの, 何らかの, いろんな, こういう, そういう, ああいう, 
-#       どういう, こんな, そんな, あんな, どんな, 大きな, 小さな, おかしな, ほんの, たいした, 
+#  e.g. この, その, あの, どの, いわゆる, なんらかの, 何らかの, いろんな, こういう, そういう, ああいう,
+#       どういう, こんな, そんな, あんな, どんな, 大きな, 小さな, おかしな, ほんの, たいした,
 #       「(, も) さる (ことながら)」, 微々たる, 堂々たる, 単なる, いかなる, 我が」「同じ, 亡き
 #連体詞
 #
@@ -279,27 +279,27 @@
 #  e.g. から, が, で, と, に, へ, より, を, の, にて
 助詞-格助詞-一般
 #
-#  particle-case-quote: the "to" that appears after nouns, a person’s speech, 
+#  particle-case-quote: the "to" that appears after nouns, a person’s speech,
 #  quotation marks, expressions of decisions from a meeting, reasons, judgements,
 #  conjectures, etc.
 #  e.g. ( だ) と (述べた.), ( である) と (して執行猶予...)
 助詞-格助詞-引用
 #
-#  particle-case-compound: Compounds of particles and verbs that mainly behave 
+#  particle-case-compound: Compounds of particles and verbs that mainly behave
 #  like case particles.
 #  e.g. という, といった, とかいう, として, とともに, と共に, でもって, にあたって, に当たって, に当って,
-#       にあたり, に当たり, に当り, に当たる, にあたる, において, に於いて,に於て, における, に於ける, 
-#       にかけ, にかけて, にかんし, に関し, にかんして, に関して, にかんする, に関する, に際し, 
-#       に際して, にしたがい, に従い, に従う, にしたがって, に従って, にたいし, に対し, にたいして, 
+#       にあたり, に当たり, に当り, に当たる, にあたる, において, に於いて,に於て, における, に於ける,
+#       にかけ, にかけて, にかんし, に関し, にかんして, に関して, にかんする, に関する, に際し,
+#       に際して, にしたがい, に従い, に従う, にしたがって, に従って, にたいし, に対し, にたいして,
 #       に対して, にたいする, に対する, について, につき, につけ, につけて, につれ, につれて, にとって,
-#       にとり, にまつわる, によって, に依って, に因って, により, に依り, に因り, による, に依る, に因る, 
+#       にとり, にまつわる, によって, に依って, に因って, により, に依り, に因り, による, に依る, に因る,
 #       にわたって, にわたる, をもって, を以って, を通じ, を通じて, を通して, をめぐって, をめぐり, をめぐる,
 #       って-口語/, ちゅう-関西弁「という」/, (何) ていう (人)-口語/, っていう-口語/, といふ, とかいふ
 助詞-格助詞-連語
 #
 #  particle-conjunctive:
-#  e.g. から, からには, が, けれど, けれども, けど, し, つつ, て, で, と, ところが, どころか, とも, ども, 
-#       ながら, なり, ので, のに, ば, ものの, や ( した), やいなや, (ころん) じゃ(いけない)-口語/, 
+#  e.g. から, からには, が, けれど, けれども, けど, し, つつ, て, で, と, ところが, どころか, とも, ども,
+#       ながら, なり, ので, のに, ば, ものの, や ( した), やいなや, (ころん) じゃ(いけない)-口語/,
 #       (行っ) ちゃ(いけない)-口語/, (言っ) たって (しかたがない)-口語/, (それがなく)ったって (平気)-口語/
 助詞-接続助詞
 #
@@ -308,9 +308,9 @@
 助詞-係助詞
 #
 #  particle-adverbial:
-#  e.g. がてら, かも, くらい, 位, ぐらい, しも, (学校) じゃ(これが流行っている)-口語/, 
+#  e.g. がてら, かも, くらい, 位, ぐらい, しも, (学校) じゃ(これが流行っている)-口語/,
 #       (それ)じゃあ (よくない)-口語/, ずつ, (私) なぞ, など, (私) なり (に), (先生) なんか (大嫌い)-口語/,
-#       (私) なんぞ, (先生) なんて (大嫌い)-口語/, のみ, だけ, (私) だって-口語/, だに, 
+#       (私) なんぞ, (先生) なんて (大嫌い)-口語/, のみ, だけ, (私) だって-口語/, だに,
 #       (彼)ったら-口語/, (お茶) でも (いかが), 等 (とう), (今後) とも, ばかり, ばっか-口語/, ばっかり-口語/,
 #       ほど, 程, まで, 迄, (誰) も (が)([助詞-格助詞] および [助詞-係助詞] の前に位置する「も」)
 助詞-副助詞
@@ -324,11 +324,11 @@
 助詞-並立助詞
 #
 #  particle-final:
-#  e.g. かい, かしら, さ, ぜ, (だ)っけ-口語/, (とまってる) で-方言/, な, ナ, なあ-口語/, ぞ, ね, ネ, 
+#  e.g. かい, かしら, さ, ぜ, (だ)っけ-口語/, (とまってる) で-方言/, な, ナ, なあ-口語/, ぞ, ね, ネ,
 #       ねぇ-口語/, ねえ-口語/, ねん-方言/, の, のう-口語/, や, よ, ヨ, よぉ-口語/, わ, わい-口語/
 助詞-終助詞
 #
-#  particle-adverbial/conjunctive/final: The particle "ka" when unknown whether it is 
+#  particle-adverbial/conjunctive/final: The particle "ka" when unknown whether it is
 #  adverbial, conjunctive, or sentence final. For example:
 #       (a) 「A か B か」. Ex:「(国内で運用する) か,(海外で運用する) か (.)」
 #       (b) Inside an adverb phrase. Ex:「(幸いという) か (, 死者はいなかった.)」
@@ -337,16 +337,16 @@
 #  e.g. か
 助詞-副助詞/並立助詞/終助詞
 #
-#  particle-adnominalizer: The "no" that attaches to nouns and modifies 
+#  particle-adnominalizer: The "no" that attaches to nouns and modifies
 #  non-inflectional words.
 助詞-連体化
 #
-#  particle-adnominalizer: The "ni" and "to" that appear following nouns and adverbs 
+#  particle-adnominalizer: The "ni" and "to" that appear following nouns and adverbs
 #  that are giongo, giseigo, or gitaigo.
 #  e.g. に, と
 助詞-副詞化
 #
-#  particle-special: A particle that does not fit into one of the above classifications. 
+#  particle-special: A particle that does not fit into one of the above classifications.
 #  This includes particles that are used in Tanka, Haiku, and other poetry.
 #  e.g. かな, けむ, ( しただろう) に, (あんた) にゃ(わからん), (俺) ん (家)
 助詞-特殊
@@ -357,7 +357,7 @@
 #
 #####
 #  interjection: Greetings and other exclamations.
-#  e.g. おはよう, おはようございます, こんにちは, こんばんは, ありがとう, どうもありがとう, ありがとうございます, 
+#  e.g. おはよう, おはようございます, こんにちは, こんばんは, ありがとう, どうもありがとう, ありがとうございます,
 #       いただきます, ごちそうさま, さよなら, さようなら, はい, いいえ, ごめん, ごめんなさい
 #感動詞
 #
@@ -395,7 +395,7 @@
 #  other: unclassified other
 #その他
 #
-#  other-interjection: Words that are hard to classify as noun-suffixes or 
+#  other-interjection: Words that are hard to classify as noun-suffixes or
 #  sentence-final particles.
 #  e.g. (だ)ァ
 その他-間投

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ar.txt

@@ -2,7 +2,7 @@
 # See http://members.unine.ch/jacques.savoy/clef/index.html.
 # Also see http://www.opensource.org/licenses/bsd-license.html
 # Cleaned on October 11, 2009 (not normalized, so use before normalization)
-# This means that when modifying this list, you might need to add some 
+# This means that when modifying this list, you might need to add some
 # redundant entries, for example containing forms with both أ and ا
 من
 ومن

+ 6 - 6
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ca.txt

@@ -88,7 +88,7 @@ havia
 he
 hem
 heu
-hi 
+hi
 ho
 i
 igual
@@ -142,7 +142,7 @@ pels
 per
 però
 perquè
-poc 
+poc
 poca
 pocs
 poques
@@ -151,7 +151,7 @@ propi
 qual
 quals
 quan
-quant 
+quant
 que
 què
 quelcom
@@ -166,7 +166,7 @@ sa
 semblant
 semblants
 ses
-seu 
+seu
 seus
 seva
 seva
@@ -177,9 +177,9 @@ sobretot
 sóc
 solament
 sols
-son 
+son
 són
-sons 
+sons
 sota
 sou
 t'ha

+ 2 - 2
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_el.txt

@@ -1,6 +1,6 @@
 # Lucene Greek Stopwords list
 # Note: by default this file is used after GreekLowerCaseFilter,
-# so when modifying this file use 'σ' instead of 'ς' 
+# so when modifying this file use 'σ' instead of 'ς'
 ο
 η
 το
@@ -11,7 +11,7 @@
 των
 τον
 την
-και 
+και
 κι
 κ
 ειμαι

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_fi.txt

@@ -4,7 +4,7 @@
  | Also see http://www.opensource.org/licenses/bsd-license.html
  |  - Encoding was converted to UTF-8.
  |  - This notice was added.
- 
+
 | forms of BE
 
 olla

+ 8 - 8
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_hi.txt

@@ -1,10 +1,10 @@
 # Also see http://www.opensource.org/licenses/bsd-license.html
 # See http://members.unine.ch/jacques.savoy/clef/index.html.
 # This file was created by Jacques Savoy and is distributed under the BSD license.
-# Note: by default this file also contains forms normalized by HindiNormalizer 
-# for spelling variation (see section below), such that it can be used whether or 
+# Note: by default this file also contains forms normalized by HindiNormalizer
+# for spelling variation (see section below), such that it can be used whether or
 # not you enable that feature. When adding additional entries to this list,
-# please add the normalized form as well. 
+# please add the normalized form as well.
 अंदर
 अत
 अपना
@@ -14,7 +14,7 @@
 आदि
 आप
 इत्यादि
-इन 
+इन
 इनका
 इन्हीं
 इन्हें
@@ -111,7 +111,7 @@
 नीचे
 ने
 पर
-पर  
+पर
 पहले
 पूरा
 पे
@@ -133,7 +133,7 @@
 यहाँ
 यही
 या
-यिह 
+यिह
 ये
 रखें
 रहा
@@ -145,11 +145,11 @@
 वर्ग
 वह
-वह 
+वह
 वहाँ
 वहीं
 वाले
-वुह 
+वुह
 वे
 वग़ैरह
 संग

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_hu.txt

@@ -4,7 +4,7 @@
  | Also see http://www.opensource.org/licenses/bsd-license.html
  |  - Encoding was converted to UTF-8.
  |  - This notice was added.
- 
+
 | Hungarian stop word list
 | prepared by Anna Tordai
 

+ 6 - 6
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_lv.txt

@@ -1,7 +1,7 @@
 # Set of Latvian stopwords from A Stemming Algorithm for Latvian, Karlis Kreslins
-# the original list of over 800 forms was refined: 
+# the original list of over 800 forms was refined:
 #   pronouns, adverbs, interjections were removed
-# 
+#
 # prepositions
 aiz
 ap
@@ -101,8 +101,8 @@ tak
 iekams
 vien
 # modal verbs
-būt  
-biju 
+būt
+biju
 biji
 bija
 bijām
@@ -110,8 +110,8 @@ bijāt
 esmu
 esi
 esam
-esat 
-būšu     
+esat
+būšu
 būsi
 būs
 būsim

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/lang/stopwords_ro.txt

@@ -121,7 +121,7 @@ ieri
 îl
 îmi
 împotriva
-în 
+în
 înainte
 înaintea
 încât

+ 3 - 3
desktop/libs/indexer/src/data/solr_configs/conf/mapping-FoldToASCII.txt

@@ -34,7 +34,7 @@
 # - Supplemental Punctuation: http://www.unicode.org/charts/PDF/U2E00.pdf
 # - Alphabetic Presentation Forms: http://www.unicode.org/charts/PDF/UFB00.pdf
 # - Halfwidth and Fullwidth Forms: http://www.unicode.org/charts/PDF/UFF00.pdf
-#  
+#
 # See: http://en.wikipedia.org/wiki/Latin_characters_in_Unicode
 #
 # The set of character conversions supported by this map is a superset of
@@ -3785,11 +3785,11 @@
 #
 # use warnings;
 # use strict;
-# 
+#
 # my @source_chars = ();
 # my @source_char_descriptions = ();
 # my $target = '';
-# 
+#
 # while (<>) {
 #   if (/case\s+'(\\u[A-F0-9]+)':\s*\/\/\s*(.*)/i) {
 #     push @source_chars, $1;

+ 61 - 61
desktop/libs/indexer/src/data/solr_configs/conf/schema.xml

@@ -27,7 +27,7 @@
  </fields>
 
  <uniqueKey><!-- REPLACE UNIQUE KEY --></uniqueKey>
- 
+
   <types>
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
 
@@ -178,7 +178,7 @@
         />
       </analyzer>
     </fieldType>
-    
+
     <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
       <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
@@ -231,7 +231,7 @@
 
     <!-- Arabic -->
     <fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- for any non-arabic -->
         <filter class="solr.LowerCaseFilterFactory"/>
@@ -244,26 +244,26 @@
 
     <!-- Bulgarian -->
     <fieldType name="text_bg" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
-        <tokenizer class="solr.StandardTokenizerFactory"/> 
+      <analyzer>
+        <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
-        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" /> 
-        <filter class="solr.BulgarianStemFilterFactory"/>       
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" />
+        <filter class="solr.BulgarianStemFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Catalan -->
     <fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
-        <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>       
+        <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
     <fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
@@ -278,27 +278,27 @@
 
     <!-- Czech -->
     <fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
-        <filter class="solr.CzechStemFilterFactory"/>       
+        <filter class="solr.CzechStemFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Danish -->
     <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />
-        <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>       
+        <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- German -->
     <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
@@ -308,10 +308,10 @@
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Greek -->
     <fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- greek specific lowercase for sigma -->
         <filter class="solr.GreekLowerCaseFilterFactory"/>
@@ -319,10 +319,10 @@
         <filter class="solr.GreekStemFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Spanish -->
     <fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" />
@@ -330,17 +330,17 @@
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Basque -->
     <fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Persian -->
     <fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
@@ -353,10 +353,10 @@
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
       </analyzer>
     </fieldType>
-    
+
     <!-- Finnish -->
     <fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
@@ -364,10 +364,10 @@
         <!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- French -->
     <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
@@ -378,10 +378,10 @@
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Irish -->
     <fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes d', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
@@ -392,10 +392,10 @@
         <filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Galician -->
     <fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
@@ -403,10 +403,10 @@
         <!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Hindi -->
     <fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <!-- normalizes unicode representation -->
@@ -417,30 +417,30 @@
         <filter class="solr.HindiStemFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Hungarian -->
     <fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
         <filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Armenian -->
     <fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Indonesian -->
     <fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
@@ -448,10 +448,10 @@
         <filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Italian -->
     <fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
@@ -480,20 +480,20 @@
         <filter class="solr.LowerCaseFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Latvian -->
     <fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
         <filter class="solr.LatvianStemFilterFactory"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Dutch -->
     <fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
@@ -501,10 +501,10 @@
         <filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Norwegian -->
     <fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
@@ -514,10 +514,10 @@
         <!-- The "light" and "minimal" stemmers support variants: nb=Bokmål, nn=Nynorsk, no=Both -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Portuguese -->
     <fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
@@ -527,20 +527,20 @@
         <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Romanian -->
     <fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
       </analyzer>
     </fieldType>
-    
+
     <!-- Russian -->
     <fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
@@ -548,10 +548,10 @@
         <!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Swedish -->
     <fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
@@ -559,20 +559,20 @@
         <!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
       </analyzer>
     </fieldType>
-    
+
     <!-- Thai -->
     <fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.ThaiWordFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
       </analyzer>
     </fieldType>
-    
+
     <!-- Turkish -->
     <fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.TurkishLowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" />

File diff suppressed because it is too large
+ 169 - 169
desktop/libs/indexer/src/data/solr_configs/conf/solrconfig.xml


File diff suppressed because it is too large
+ 170 - 170
desktop/libs/indexer/src/data/solr_configs/conf/solrconfig.xml.secure


+ 4 - 4
desktop/libs/indexer/src/data/solr_configs/conf/velocity/VM_global_library.vm

@@ -19,7 +19,7 @@
 
 #macro(debug)#if($request.params.get('debugQuery'))&debugQuery=true#end#end
 
-#macro(boostPrice)#if($request.params.get('bf') == 'price')&bf=price#end#end        
+#macro(boostPrice)#if($request.params.get('bf') == 'price')&bf=price#end#end
 
 #macro(annotate)#if($request.params.get('annotateBrowse'))&annotateBrowse=true#end#end
 
@@ -35,7 +35,7 @@
 
 #macro(lensNoQ)?#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#sort($request.params.getParams('sort'))#debug#boostPrice#annotate#spatial#qOpts#group#end
 #macro(lens)#lensNoQ#q#end
-        
+
 
 #macro(url_for_lens)#{url_for_home}#lens#end
 
@@ -91,7 +91,7 @@
       #end
     #end
     </ul>
-  #end      
+  #end
 #end
 
 
@@ -150,7 +150,7 @@ $pad$v##
 $v##
     #end
   #end
-#end  
+#end
 
 #macro(utc_date $theDate)
 $date.format("yyyy-MM-dd'T'HH:mm:ss'Z'",$theDate,$date.getLocale(),$date.getTimeZone().getTimeZone("UTC"))##

+ 4 - 4
desktop/libs/indexer/src/data/solr_configs/conf/velocity/jquery.autocomplete.css

@@ -19,15 +19,15 @@
 	padding: 2px 5px;
 	cursor: default;
 	display: block;
-	/* 
-	if width will be 100% horizontal scrollbar will apear 
+	/*
+	if width will be 100% horizontal scrollbar will apear
 	when scroll mode will be used
 	*/
 	/*width: 100%;*/
 	font: menu;
 	font-size: 12px;
-	/* 
-	it is very important, if line-height not setted or setted 
+	/*
+	it is very important, if line-height not setted or setted
 	in relative units scroll will be broken in firefox
 	*/
 	line-height: 16px;

+ 9 - 9
desktop/libs/indexer/src/data/solr_configs/conf/velocity/jquery.autocomplete.js

@@ -325,7 +325,7 @@ $.Autocompleter = function(input, options) {
 		if (!options.matchCase)
 			term = term.toLowerCase();
 		var data = cache.load(term);
-		data = null; // Avoid buggy cache and go to Solr every time 
+		data = null; // Avoid buggy cache and go to Solr every time
 		// recieve the cached data
 		if (data && data.length) {
 			success(term, data);
@@ -419,7 +419,7 @@ $.Autocompleter.Cache = function(options) {
 	var length = 0;
 	
 	function matchSubset(s, sub) {
-		if (!options.matchCase) 
+		if (!options.matchCase)
 			s = s.toLowerCase();
 		var i = s.indexOf(sub);
 		if (options.matchContains == "word"){
@@ -433,7 +433,7 @@ $.Autocompleter.Cache = function(options) {
 		if (length > options.cacheLength){
 			flush();
 		}
-		if (!data[q]){ 
+		if (!data[q]){
 			length++;
 		}
 		data[q] = value;
@@ -463,7 +463,7 @@ $.Autocompleter.Cache = function(options) {
 				
 			var firstChar = value.charAt(0).toLowerCase();
 			// if no lookup array for this character exists, look it up now
-			if( !stMatchSets[firstChar] ) 
+			if( !stMatchSets[firstChar] )
 				stMatchSets[firstChar] = [];
 
 			// if the match is a string
@@ -506,7 +506,7 @@ $.Autocompleter.Cache = function(options) {
 		load: function(q) {
 			if (!options.cacheLength || !length)
 				return null;
-			/* 
+			/*
 			 * if dealing w/local data and matchContains than we must make sure
 			 * to loop through all the data collections looking for matches
 			 */
@@ -528,7 +528,7 @@ $.Autocompleter.Cache = function(options) {
 					}
 				}				
 				return csub;
-			} else 
+			} else
 			// if the exact item exists, use it
 			if (data[q]){
 				return data[q];
@@ -578,7 +578,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		list = $("<ul/>").appendTo(element).mouseover( function(event) {
 			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
 	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-			    $(target(event)).addClass(CLASSES.ACTIVE);            
+			    $(target(event)).addClass(CLASSES.ACTIVE);
 	        }
 		}).click(function(event) {
 			$(target(event)).addClass(CLASSES.ACTIVE);
@@ -596,7 +596,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 			element.css("width", options.width);
 			
 		needsInit = false;
-	} 
+	}
 	
 	function target(event) {
 		var element = event.target;
@@ -726,7 +726,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
 					}
                 }
-                
+
             }
 		},
 		selected: function() {

+ 7 - 7
desktop/libs/indexer/src/data/solr_configs/conf/velocity/main.css

@@ -1,6 +1,6 @@
 #admin{
   text-align: right;
-  vertical-align: top; 
+  vertical-align: top;
 }
 
 #head{
@@ -46,7 +46,7 @@ a {
   width: 185px;
   padding: 5px;
   top: -20px;
-  position: relative;  
+  position: relative;
 }
 
 .tabs-bar {
@@ -142,11 +142,11 @@ a {
 }
 
 .query-box {
-  
+
 }
 
 .query-boost {
-  
+
   top: 10px;
   left: 50px;
   position: relative;
@@ -156,7 +156,7 @@ a {
 .query-box .inputs{
   left: 180px;
   position: relative;
-  
+
 }
 
 #logo {
@@ -194,13 +194,13 @@ a {
 }
 
 .mlt{
-  
+
 }
 
 .map{
   float: right;
   position: relative;
-  top: -25px;  
+  top: -25px;
 }
 
 .result-document:nth-child(2n+1) {

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/velocity/query_group.vm

@@ -34,7 +34,7 @@
         </option>
 
       </select>
-    </label>  
+    </label>
 
     <input type="hidden" name="group" value="true"/>
 

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/velocity/query_spatial.vm

@@ -53,7 +53,7 @@
 
     <input type="hidden" name="sfield" value="store"/>
     <input type="hidden" id="spatialFQ" name="fq" value=""/>
-    <input type="hidden" name="queryOpts" value="spatial"/>        
+    <input type="hidden" name="queryOpts" value="spatial"/>
 
   </div>
 

+ 1 - 1
desktop/libs/indexer/src/data/solr_configs/conf/velocity/richtext_doc.vm

@@ -77,7 +77,7 @@
 ## Resource Name
 <div>
   #if($doc.getFieldValue('resourcename'))
-    Resource name: $filename 
+    Resource name: $filename
   #elseif($url)
     URL: $url
   #end

+ 7 - 7
desktop/libs/indexer/src/data/solr_configs/conf/xslt/example.xsl

@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,17 +17,17 @@
  * limitations under the License.
  -->
 
-<!-- 
+<!--
   Simple transform of Solr query results to HTML
  -->
 <xsl:stylesheet version='1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
 >
 
-  <xsl:output media-type="text/html" encoding="UTF-8"/> 
-  
+  <xsl:output media-type="text/html" encoding="UTF-8"/>
+
   <xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
-  
+
   <xsl:template match='/'>
     <html>
       <head>
@@ -44,7 +44,7 @@
       </body>
     </html>
   </xsl:template>
-  
+
   <xsl:template match="doc">
     <xsl:variable name="pos" select="position()"/>
     <div class="doc">
@@ -110,7 +110,7 @@
   </xsl:template>
 
   <xsl:template match="*"/>
-  
+
   <xsl:template name="css">
     <script>
       function toggle(id) {

+ 4 - 4
desktop/libs/indexer/src/data/solr_configs/conf/xslt/example_atom.xsl

@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,7 +17,7 @@
  * limitations under the License.
  -->
 
-<!-- 
+<!--
   Simple transform of Solr query results to Atom
  -->
 
@@ -42,7 +42,7 @@
         <name>Apache Solr</name>
         <email>solr-user@lucene.apache.org</email>
       </author>
-      <link rel="self" type="application/atom+xml" 
+      <link rel="self" type="application/atom+xml"
             href="http://localhost:8983/solr/q={$query}&amp;wt=xslt&amp;tr=atom.xsl"/>
       <updated>
         <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
@@ -51,7 +51,7 @@
       <xsl:apply-templates select="response/result/doc"/>
     </feed>
   </xsl:template>
-    
+
   <!-- search results xslt -->
   <xsl:template match="doc">
     <xsl:variable name="id" select="str[@name='id']"/>

+ 3 - 3
desktop/libs/indexer/src/data/solr_configs/conf/xslt/example_rss.xsl

@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,7 +17,7 @@
  * limitations under the License.
  -->
 
-<!-- 
+<!--
   Simple transform of Solr query results to RSS
  -->
 
@@ -44,7 +44,7 @@
        </channel>
     </rss>
   </xsl:template>
-  
+
   <!-- search results xslt -->
   <xsl:template match="doc">
     <xsl:variable name="id" select="str[@name='id']"/>

+ 4 - 4
desktop/libs/indexer/src/data/solr_configs/conf/xslt/luke.xsl

@@ -6,9 +6,9 @@
     The ASF licenses this file to You under the Apache License, Version 2.0
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
-    
+
     http://www.apache.org/licenses/LICENSE-2.0
-    
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
 -->
 
 
-<!-- 
+<!--
   Display the luke request handler with graphs
  -->
 <xsl:stylesheet
@@ -190,7 +190,7 @@
                  <div class="histogram">
                   <xsl:attribute name="style">background-color: <xsl:value-of select="$fill"/>; width: <xsl:value-of select="$bar_width"/>px; height: <xsl:value-of select="($iheight*number(.)) div $max"/>px;</xsl:attribute>
                  </div>
-                   </td> 
+                   </td>
                 </xsl:for-each>
               </tr>
               <tr>

+ 3 - 3
desktop/libs/indexer/src/data/solr_configs/conf/xslt/updateXml.xsl

@@ -1,4 +1,4 @@
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -30,7 +30,7 @@
         <xsl:apply-templates select="response/result/doc"/>
     </add>
   </xsl:template>
-  
+
   <!-- Ignore score (makes no sense to index) -->
   <xsl:template match="doc/*[@name='score']" priority="100">
   </xsl:template>
@@ -47,7 +47,7 @@
   <!-- Flatten arrays to duplicate field lines -->
   <xsl:template match="doc/arr" priority="100">
       <xsl:variable name="fn" select="@name"/>
-      
+
       <xsl:for-each select="*">
 		<xsl:element name="field">
 		    <xsl:attribute name="name"><xsl:value-of select="$fn"/></xsl:attribute>

+ 3 - 3
desktop/libs/indexer/src/indexer/templates/collections.mako

@@ -56,7 +56,7 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
 </style>
 
 
-<div class="search-bar" style="height: 30px">  
+<div class="search-bar" style="height: 30px">
   <div class="pull-right" style="margin-right: 20px">
     <a class="btn importBtn" href="${ url('search:admin_collections') }" title="${ _('Collections') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}">
       <i class="fa fa-tags"></i> ${ _('Dashboards') }
@@ -154,7 +154,7 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
           <div data-bind="visible: collections().length > 0 && !isLoading()">
             <input type="text" data-bind="filter: { 'list': collections, 'filteredList': filteredCollections, 'test': filterTest }"
                 placeholder="${_('Filter collections...')}" class="input-xlarge search-query">
-            <button data-bind="clickBubble: false, disable: selectedCollections().length == 0" class="btn toolbarBtn" 
+            <button data-bind="clickBubble: false, disable: selectedCollections().length == 0" class="btn toolbarBtn"
                 title="${_('Delete the selected collections')}" data-toggle="modal" data-target="#deleteCollections">
               <i class="fa fa-times"></i> ${_('Delete')}
             </button>
@@ -338,7 +338,7 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
     <ul class="nav nav-list">
       <li class="nav-header">${_('Actions')}</li>
       <li><a data-bind="attr: { href: '/search/browse/' + collection().name() }"><i class="fa fa-search"></i> ${ _('Search') }</a></li>
-      <li><a data-bind="routie: 'edit/' + collection().name() + '/upload'" href="javascript:void(0)"><i class="fa fa-arrow-circle-o-down"></i> ${_('Index file')}</a></li>      
+      <li><a data-bind="routie: 'edit/' + collection().name() + '/upload'" href="javascript:void(0)"><i class="fa fa-arrow-circle-o-down"></i> ${_('Index file')}</a></li>
       <li><a href="#deleteCollection" data-toggle="modal"><i class="fa fa-times"></i> ${_('Delete')}</a></li>
     </ul>
   </div>

+ 3 - 3
desktop/libs/indexer/static/help/index.html

@@ -4,14 +4,14 @@
 <p>The Solr Search application, which is based on  <a href="http://lucene.apache.org/solr/">Apache Solr</a>, allows you to perform keyword searches across Hadoop data. A wizard lets you style the result snippets, specify facets to group the results, sort the results, and highlight result fields.</p>
 
                 <h2 class="subhead"><a href="http://gethue.tumblr.com/post/66351828212/new-search-feature-graphical-facets">New Search feature: Graphical facets</a></h2>
-                
-                
+
+
                 <p>
                     <p>This new feature completed in <a href="http://gethue.tumblr.com/post/66661140648/hue-team-retreat-thailand">Thailand</a> lets you search interactively:</p>
 <p><iframe frameborder="0" height="495" src="http://player.vimeo.com/video/78887745" width="900"></iframe></p>
 <p>As usual feel free to comment on the <a href="https://groups.google.com/a/cloudera.org/group/hue-user/">hue-user</a> list or <a href="https://twitter.com/gethue">@gethue</a>!</p>
                 </p>
-                
+
 
 <h2>Solr Search Installation and Configuration</h2>
 

Some files were not shown because too many files changed in this diff