Browse Source

[search] Trailing whitespaces and tabs cleanup

Romain Rigaux 11 years ago
parent
commit
7ce38bb494
48 changed files with 1002 additions and 1002 deletions
  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
       SLOTS = 10
     else:
     else:
       SLOTS = 100
       SLOTS = 100
-      
+
     stats_json = solr_api.stats(collection['name'], [facet_field])
     stats_json = solr_api.stats(collection['name'], [facet_field])
     stat_facet = stats_json['stats']['stats_fields'][facet_field]
     stat_facet = stats_json['stats']['stats_fields'][facet_field]
     is_date = False
     is_date = False
-    
+
     # to refactor
     # to refactor
     if isinstance(stat_facet['min'], numbers.Number):
     if isinstance(stat_facet['min'], numbers.Number):
       stats_min = int(stat_facet['min']) # Cast floats to int currently
       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 start is None:
         if widget_type == 'line-widget':
         if widget_type == 'line-widget':
           start, _ = _round_thousand_range(stats_min)
           start, _ = _round_thousand_range(stats_min)
-        else:        
+        else:
           start, _ =  _round_number_range(stats_min)
           start, _ =  _round_number_range(stats_min)
       else:
       else:
         start = int(start)
         start = int(start)
@@ -71,12 +71,12 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
         if widget_type == 'line-widget':
         if widget_type == 'line-widget':
           _, end = _round_thousand_range(stats_max)
           _, end = _round_thousand_range(stats_max)
         else:
         else:
-          _, end = _round_number_range(stats_max)        
+          _, end = _round_number_range(stats_max)
       else:
       else:
         end = int(end)
         end = int(end)
 
 
       if gap is None:
       if gap is None:
-        gap = int((end - start) / SLOTS)      
+        gap = int((end - start) / SLOTS)
       if gap < 1:
       if gap < 1:
         gap = 1
         gap = 1
     elif 'T' in stat_facet['min']:
     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_min = stat_facet['min']
       stats_max = stat_facet['max']
       stats_max = stat_facet['max']
       if start is None:
       if start is None:
-        start = stats_min 
+        start = stats_min
       start = re.sub('\.\d\d?\d?Z$', 'Z', start)
       start = re.sub('\.\d\d?\d?Z$', 'Z', start)
       try:
       try:
         start_ts = datetime.strptime(start, '%Y-%m-%dT%H:%M:%SZ')
         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_ts, _ = _round_date_range(start_ts)
       start = start_ts.strftime('%Y-%m-%dT%H:%M:%SZ')
       start = start_ts.strftime('%Y-%m-%dT%H:%M:%SZ')
       stats_min = min(stats_min, start)
       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')
       end = end_ts.strftime('%Y-%m-%dT%H:%M:%SZ')
       stats_max = max(stats_max, end)
       stats_max = max(stats_max, end)
       difference = (
       difference = (
-          mktime(end_ts.timetuple()) - 
+          mktime(end_ts.timetuple()) -
           mktime(start_ts.timetuple())
           mktime(start_ts.timetuple())
       ) / SLOTS
       ) / SLOTS
 
 
@@ -119,7 +119,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       elif difference < 60 * 10:
       elif difference < 60 * 10:
         gap = '+10MINUTES'
         gap = '+10MINUTES'
       elif difference < 60 * 30:
       elif difference < 60 * 30:
-        gap = '+30MINUTES'                
+        gap = '+30MINUTES'
       elif difference < 3600:
       elif difference < 3600:
         gap = '+1HOURS'
         gap = '+1HOURS'
       elif difference < 3600 * 3:
       elif difference < 3600 * 3:
@@ -129,11 +129,11 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
       elif difference < 3600 * 24:
       elif difference < 3600 * 24:
         gap = '+1DAYS'
         gap = '+1DAYS'
       elif difference < 3600 * 24 * 7:
       elif difference < 3600 * 24 * 7:
-        gap = '+7DAYS'        
+        gap = '+7DAYS'
       elif difference < 3600 * 24 * 40:
       elif difference < 3600 * 24 * 40:
-        gap = '+1MONTHS'        
+        gap = '+1MONTHS'
       else:
       else:
-        gap = '+1YEARS'      
+        gap = '+1YEARS'
 
 
     properties.update({
     properties.update({
       'min': stats_min,
       'min': stats_min,
@@ -151,7 +151,7 @@ def _guess_range_facet(widget_type, solr_api, collection, facet_field, propertie
 
 
 def _round_date_range(tm):
 def _round_date_range(tm):
   start = tm - timedelta(minutes=tm.minute, seconds=tm.second, microseconds=tm.microsecond)
   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
   return start, end
 
 
 def _round_number_range(n):
 def _round_number_range(n):
@@ -161,7 +161,7 @@ def _round_number_range(n):
     i = int(log(n, 10))
     i = int(log(n, 10))
     end = round(n, -i)
     end = round(n, -i)
     start = end - 10 ** i
     start = end - 10 ** i
-    return start, end 
+    return start, end
 
 
 def _round_thousand_range(n):
 def _round_thousand_range(n):
   if n <= 10:
   if n <= 10:
@@ -170,7 +170,7 @@ def _round_thousand_range(n):
     i = int(log(n, 10))
     i = int(log(n, 10))
     start = 10 ** i
     start = 10 ** i
     end = 10 ** (i + 1)
     end = 10 ** (i + 1)
-    return start, end 
+    return start, end
 
 
 def _guess_gap(solr_api, collection, facet, start=None, end=None):
 def _guess_gap(solr_api, collection, facet, start=None, end=None):
   properties = {}
   properties = {}
@@ -204,14 +204,14 @@ class SolrApi(BaseSolrApi):
 
 
   #@demo_handler
   #@demo_handler
   def query(self, collection, query):
   def query(self, collection, query):
-    solr_query = {}      
-    
+    solr_query = {}
+
     solr_query['collection'] = collection['name']
     solr_query['collection'] = collection['name']
     solr_query['rows'] = min(int(collection['template']['rows'] or 10), 1000)
     solr_query['rows'] = min(int(collection['template']['rows'] or 10), 1000)
     solr_query['start'] = min(int(query['start']), 10000)
     solr_query['start'] = min(int(query['start']), 10000)
-    
+
     q_template = '(%s)' if len(query['qs']) >= 2 else '%s'
     q_template = '(%s)' if len(query['qs']) >= 2 else '%s'
-          
+
     params = self._get_params() + (
     params = self._get_params() + (
         ('q', 'OR'.join([q_template % (q['q'] or EMPTY_QUERY.get()) for q in query['qs']])),
         ('q', 'OR'.join([q_template % (q['q'] or EMPTY_QUERY.get()) for q in query['qs']])),
         ('wt', 'json'),
         ('wt', 'json'),
@@ -227,7 +227,7 @@ class SolrApi(BaseSolrApi):
       )
       )
       for facet in collection['facets']:
       for facet in collection['facets']:
         if facet['type'] == 'query':
         if facet['type'] == 'query':
-          params += (('facet.query', '%s' % facet['field']),)          
+          params += (('facet.query', '%s' % facet['field']),)
         elif facet['type'] == 'range':
         elif facet['type'] == 'range':
           params += tuple([
           params += tuple([
              ('facet.range', '{!ex=%s}%s' % (facet['field'], facet['field'])),
              ('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.end' % facet['field'], facet['properties']['end']),
              ('f.%s.facet.range.gap' % facet['field'], facet['properties']['gap']),
              ('f.%s.facet.range.gap' % facet['field'], facet['properties']['gap']),
              ('f.%s.facet.mincount' % facet['field'], facet['properties']['mincount']),]
              ('f.%s.facet.mincount' % facet['field'], facet['properties']['mincount']),]
-          )          
+          )
         elif facet['type'] == 'field':
         elif facet['type'] == 'field':
           params += (
           params += (
               ('facet.field', '{!ex=%s}%s' % (facet['field'], facet['field'])),
               ('facet.field', '{!ex=%s}%s' % (facet['field'], facet['field'])),
@@ -245,10 +245,10 @@ class SolrApi(BaseSolrApi):
 
 
     for fq in query['fqs']:
     for fq in query['fqs']:
       if fq['type'] == 'field':
       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']])),)
         # params += (('fq', ' '.join([urllib.unquote(utf_quoter('{!tag=%s}{!field f=%s}%s' % (fq['field'], fq['field'], _filter))) for _filter in fq['filter']])),)
         f = []
         f = []
-        for _filter in fq['filter']:          
+        for _filter in fq['filter']:
           if _filter is not None and ' ' in _filter:
           if _filter is not None and ' ' in _filter:
             f.append('%s:"%s"' % (fq['field'], _filter))
             f.append('%s:"%s"' % (fq['field'], _filter))
           else:
           else:
@@ -277,7 +277,7 @@ class SolrApi(BaseSolrApi):
           if attribute_field[0]['sort']['direction']:
           if attribute_field[0]['sort']['direction']:
             fields.append('%s %s' % (field, attribute_field[0]['sort']['direction']))
             fields.append('%s %s' % (field, attribute_field[0]['sort']['direction']))
       if fields:
       if fields:
-        params += (         
+        params += (
           ('sort', ','.join(fields)),
           ('sort', ','.join(fields)),
         )
         )
 
 
@@ -371,7 +371,7 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
           ('wt', 'json'),
       )
       )
       response = self._root.get('%(core)s/admin/luke' % {'core': core}, params=params)
       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:
     except RestException, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
       raise PopupException(e, title=_('Error while accessing Solr'))
 
 
@@ -381,10 +381,10 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
           ('wt', 'json'),
       )
       )
       response = self._root.get('%(core)s/schema/fields' % {'core': core}, params=params)
       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:
     except RestException, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
       raise PopupException(e, title=_('Error while accessing Solr'))
-    
+
   def stats(self, core, fields):
   def stats(self, core, fields):
     try:
     try:
       params = (
       params = (
@@ -392,7 +392,7 @@ class SolrApi(BaseSolrApi):
           ('wt', 'json'),
           ('wt', 'json'),
           ('rows', 0),
           ('rows', 0),
           ('stats', 'true'),
           ('stats', 'true'),
-      )      
+      )
       params += tuple([('stats.field', field) for field in fields])
       params += tuple([('stats.field', field) for field in fields])
       response = self._root.get('%(core)s/select' % {'core': core}, params=params)
       response = self._root.get('%(core)s/select' % {'core': core}, params=params)
       return self._get_json(response)
       return self._get_json(response)
@@ -404,7 +404,7 @@ class SolrApi(BaseSolrApi):
       params = (
       params = (
           ('id', doc_id),
           ('id', doc_id),
           ('wt', 'json'),
           ('wt', 'json'),
-      )      
+      )
       response = self._root.get('%(core)s/get' % {'core': core}, params=params)
       response = self._root.get('%(core)s/get' % {'core': core}, params=params)
       return self._get_json(response)
       return self._get_json(response)
     except RestException, e:
     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_json = json.loads(request.POST.get('collection', '{}'))
     collection = Collection.objects.get(id=collection_json['id']) # TODO perms with doc model HUE-1987
     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.")
       message = _("Permission denied. You are not an Administrator.")
       raise PopupException(message)
       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)
       return view_fn(request, *args, **kwargs)
     except Exception, e:
     except Exception, e:
       from search.api import SolrApi
       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)
         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)
         return SolrApi._get_json(LOG_SEARCH_RESPONSE)
       else:
       else:
         raise e
         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):
 class CollectionManager(models.Manager):
- 
+
   def create2(self, name, label, is_core_only=False):
   def create2(self, name, label, is_core_only=False):
     facets = Facet.objects.create()
     facets = Facet.objects.create()
-    result = Result.objects.create()      
+    result = Result.objects.create()
     sorting = Sorting.objects.create()
     sorting = Sorting.objects.create()
 
 
     collection = Collection.objects.create(
     collection = Collection.objects.create(
@@ -251,7 +251,7 @@ class Collection(models.Model):
   def get_c(self, user):
   def get_c(self, user):
     props = self.properties_dict
     props = self.properties_dict
 
 
-    if 'collection' not in props:      
+    if 'collection' not in props:
       props['collection'] = self.get_default(user)
       props['collection'] = self.get_default(user)
       if self.cores != '{}': # Convert collections from < Hue 3.6
       if self.cores != '{}': # Convert collections from < Hue 3.6
         try:
         try:
@@ -260,8 +260,8 @@ class Collection(models.Model):
           LOG.error('Could not import collection: %s' % e)
           LOG.error('Could not import collection: %s' % e)
 
 
     if 'layout' not in props:
     if 'layout' not in props:
-      props['layout'] = []    
-  
+      props['layout'] = []
+
     if self.id:
     if self.id:
       props['collection']['id'] = self.id
       props['collection']['id'] = self.id
     if self.name:
     if self.name:
@@ -270,21 +270,21 @@ class Collection(models.Model):
       props['collection']['label'] = self.label
       props['collection']['label'] = self.label
     if self.enabled is not None:
     if self.enabled is not None:
       props['collection']['enabled'] = self.enabled
       props['collection']['enabled'] = self.enabled
-    
+
     # tmp for dev
     # tmp for dev
     if 'rows' not in props['collection']['template']:
     if 'rows' not in props['collection']['template']:
       props['collection']['template']['rows'] = 10
       props['collection']['template']['rows'] = 10
     if 'enabled' not in props['collection']:
     if 'enabled' not in props['collection']:
       props['collection']['enabled'] = True
       props['collection']['enabled'] = True
-      
+
     return json.dumps(props)
     return json.dumps(props)
 
 
-  def get_default(self, user):      
+  def get_default(self, user):
     fields = self.fields_data(user)
     fields = self.fields_data(user)
     id_field = [field['name'] for field in fields if field.get('isId')]
     id_field = [field['name'] for field in fields if field.get('isId')]
     if id_field:
     if id_field:
       id_field = id_field[0]
       id_field = id_field[0]
-  
+
     TEMPLATE = {
     TEMPLATE = {
       "extracode": escape("<style type=\"text/css\">\nem {\n  font-weight: bold;\n  background-color: yellow;\n}</style>\n\n<script>\n</script>"),
       "extracode": escape("<style type=\"text/css\">\nem {\n  font-weight: bold;\n  background-color: yellow;\n}</style>\n\n<script>\n</script>"),
       "highlighting": [""],
       "highlighting": [""],
@@ -295,21 +295,21 @@ class Collection(models.Model):
           <div class="span12">%s</div>
           <div class="span12">%s</div>
         </div>
         </div>
         <br/>
         <br/>
-      </div>""" % ' '.join(['{{%s}}' % field['name'] for field in fields]), 
+      </div>""" % ' '.join(['{{%s}}' % field['name'] for field in fields]),
       "isGridLayout": True,
       "isGridLayout": True,
       "showFieldList": True,
       "showFieldList": True,
       "fieldsAttributes": [self._make_gridlayout_header_field(field) for field in fields],
       "fieldsAttributes": [self._make_gridlayout_header_field(field) for field in fields],
       "fieldsSelected": [],
       "fieldsSelected": [],
       "rows": 10,
       "rows": 10,
     }
     }
-    
+
     FACETS = []
     FACETS = []
 
 
     return {
     return {
       'id': self.id, 'name': self.name, 'label': self.label, 'enabled': self.enabled,
       '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
   @classmethod
   def _make_field(cls, field, attributes):
   def _make_field(cls, field, attributes):
@@ -319,7 +319,7 @@ class Collection(models.Model):
         'isId': attributes.get('required') and attributes.get('uniqueKey'),
         'isId': attributes.get('required') and attributes.get('uniqueKey'),
         'isDynamic': 'dynamicBase' in attributes
         'isDynamic': 'dynamicBase' in attributes
     }
     }
-  
+
   @classmethod
   @classmethod
   def _make_gridlayout_header_field(cls, field, isDynamic=False):
   def _make_gridlayout_header_field(cls, field, isDynamic=False):
     return {'name': field['name'], 'sort': {'direction': None}, 'isDynamic': isDynamic}
     return {'name': field['name'], 'sort': {'direction': None}, 'isDynamic': isDynamic}
@@ -344,11 +344,11 @@ class Collection(models.Model):
 
 
     # Backward compatibility conversions
     # Backward compatibility conversions
     if 'autocomplete' not in properties_python:
     if 'autocomplete' not in properties_python:
-      properties_python['autocomplete'] = False    
+      properties_python['autocomplete'] = False
     if 'collection' in properties_python:
     if 'collection' in properties_python:
       if 'showFieldList' not in properties_python['collection']['template']:
       if 'showFieldList' not in properties_python['collection']['template']:
         properties_python['collection']['template']['showFieldList'] = True
         properties_python['collection']['template']['showFieldList'] = True
-    
+
     return properties_python
     return properties_python
 
 
   def update_properties(self, post_data):
   def update_properties(self, post_data):
@@ -392,11 +392,11 @@ class Collection(models.Model):
                "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]
                "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]
           }], "drops":["temp"],"klass":"card card-home card-column span10"}
           }], "drops":["temp"],"klass":"card card-home card-column span10"}
      ]
      ]
-    
+
     from search.views import _create_facet
     from search.views import _create_facet
-    
+
     props['collection']['facets'] =[]
     props['collection']['facets'] =[]
-    facets = self.facets.get_data()         
+    facets = self.facets.get_data()
 
 
     for facet_id in facets['order']:
     for facet_id in facets['order']:
       for facet in facets['fields'] + facets['ranges']:
       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'])
         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])
         counts = pairwise2(name, selected_values.get((facet['id'], name, category), []), response['facet_counts']['facet_fields'][name])
         if collection_facet['properties']['sort'] == 'asc':
         if collection_facet['properties']['sort'] == 'asc':
-          counts.reverse()          
+          counts.reverse()
         facet = {
         facet = {
           'id': collection_facet['id'],
           'id': collection_facet['id'],
           'field': name,
           'field': name,
@@ -489,12 +489,12 @@ def augment_solr_response(response, collection, query):
             'type': category,
             'type': category,
             'label': name,
             'label': name,
             'count': value,
             'count': value,
-          }        
+          }
           normalized_facets.append(facet)
           normalized_facets.append(facet)
-      # pivot_facet          
+      # pivot_facet
 
 
   # HTML escaping
   # HTML escaping
-  for doc in response['response']['docs']:  
+  for doc in response['response']['docs']:
     for field, value in doc.iteritems():
     for field, value in doc.iteritems():
       if isinstance(value, numbers.Number):
       if isinstance(value, numbers.Number):
         escaped_value = value
         escaped_value = value
@@ -504,10 +504,10 @@ def augment_solr_response(response, collection, query):
       doc[field] = escaped_value
       doc[field] = escaped_value
     doc['showDetails'] = False
     doc['showDetails'] = False
     doc['details'] = []
     doc['details'] = []
-      
+
   highlighted_fields = response.get('highlighting', {}).keys()
   highlighted_fields = response.get('highlighting', {}).keys()
   if highlighted_fields:
   if highlighted_fields:
-    id_field = collection.get('idField')    
+    id_field = collection.get('idField')
     if id_field:
     if id_field:
       for doc in response['response']['docs']:
       for doc in response['response']['docs']:
         if id_field in doc and doc[id_field] in highlighted_fields:
         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):
 def augment_solr_exception(response, collection):
   response.update(
   response.update(
   {
   {
-    "facet_counts": {   
+    "facet_counts": {
     },
     },
     "highlighting": {
     "highlighting": {
     },
     },
@@ -549,4 +549,4 @@ def augment_solr_exception(response, collection):
       "docs": [
       "docs": [
       ]
       ]
     }
     }
-  }) 
+  })

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

@@ -91,6 +91,6 @@ class SearchController(object):
 
 
   def get_solr_collection(self):
   def get_solr_collection(self):
     return SolrApi(SOLR_URL.get(), self.user).collections()
     return SolrApi(SOLR_URL.get(), self.user).collections()
-  
+
   def get_all_indexes(self):
   def get_all_indexes(self):
     return self.get_solr_collection().keys() + SolrApi(SOLR_URL.get(), self.user).cores().keys()
     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()">
       <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && !isLoading()">
       &nbsp;
       &nbsp;
       &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>
 
 
-    <%def name="creation()">    
+    <%def name="creation()">
     </%def>
     </%def>
   </%actionbar:render>
   </%actionbar:render>
 
 
@@ -57,7 +57,7 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
         ${ _('There are currently no dashboards defined.') }<br/>
         ${ _('There are currently no dashboards defined.') }<br/>
         <a class="btn importBtn" href="${ url('search:new_search') }">
         <a class="btn importBtn" href="${ url('search:new_search') }">
           <i class="fa fa-plus-circle"></i> ${ _('Dashboard') }
           <i class="fa fa-plus-circle"></i> ${ _('Dashboard') }
-        </a> 
+        </a>
       </h1>
       </h1>
     </div>
     </div>
   </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 ') }
         ${ _('... First create a search dashboard with ') }
         <a class="btn importBtn" href="${ url('search:new_search') }">
         <a class="btn importBtn" href="${ url('search:new_search') }">
           <i class="fa fa-file-o"></i> ${ _('Dashboard') }
           <i class="fa fa-file-o"></i> ${ _('Dashboard') }
-        </a>      
+        </a>
       </h1>
       </h1>
       <h1>
       <h1>
         ${ _('... or create a search index with ') }
         ${ _('... or create a search index with ') }
         <a class="btn importBtn" href="${ url('indexer:collections') }">
         <a class="btn importBtn" href="${ url('indexer:collections') }">
           <i class="fa fa-database"></i> ${ _('Indexer') }
           <i class="fa fa-database"></i> ${ _('Indexer') }
-        </a>      
+        </a>
       </h1>
       </h1>
       % endif
       % endif
     </div>
     </div>

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

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

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

@@ -76,7 +76,7 @@ class TestSearchBase(object):
 class TestWithMockedSolr(TestSearchBase):
 class TestWithMockedSolr(TestSearchBase):
   def _get_collection_param(self, collection):
   def _get_collection_param(self, collection):
     col_json = json.loads(collection.get_c(self.user))
     col_json = json.loads(collection.get_c(self.user))
-    return col_json['collection']    
+    return col_json['collection']
 
 
   def test_index(self):
   def test_index(self):
     response = self.c.get(reverse('search:index'))
     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': 'category'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'comments'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'comments'},
          {'isDynamic': False, 'isId': None, 'type': 'text_general', 'name': 'content'},
          {'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': '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': 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)
          self.collection.fields_data(self.user)
     )
     )
 
 
@@ -155,7 +155,7 @@ class TestWithMockedSolr(TestSearchBase):
         'collection': json.dumps(self._get_collection_param(self.collection)),
         'collection': json.dumps(self._get_collection_param(self.collection)),
         'query': json.dumps(QUERY)
         '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('application/csv', csv_response['Content-Type'])
     assert_equal(7434, len(csv_response_content))
     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)
     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'^new_search', 'new_search', name='new_search'),
   url(r'^browse/(?P<name>\w+)', 'browse', name='browse'),
   url(r'^browse/(?P<name>\w+)', 'browse', name='browse'),
   url(r'^download$', 'download', name='download'),
   url(r'^download$', 'download', name='download'),
-  
+
   url(r'^admin/collections$', 'admin_collections', name='admin_collections'),
   url(r'^admin/collections$', 'admin_collections', name='admin_collections'),
 
 
   # Ajax
   # Ajax
@@ -37,7 +37,7 @@ urlpatterns = patterns('search.views',
   url(r'^get_timeline$', 'get_timeline', name='get_timeline'),
   url(r'^get_timeline$', 'get_timeline', name='get_timeline'),
   url(r'^get_collection$', 'get_collection', name='get_collection'),
   url(r'^get_collection$', 'get_collection', name='get_collection'),
   url(r'^get_collections$', 'get_collections', name='get_collections'),
   url(r'^get_collections$', 'get_collections', name='get_collections'),
-  
+
   # Admin
   # Admin
   url(r'^admin/collection_delete$', 'admin_collection_delete', name='admin_collection_delete'),
   url(r'^admin/collection_delete$', 'admin_collection_delete', name='admin_collection_delete'),
   url(r'^admin/collection_copy$', 'admin_collection_copy', name='admin_collection_copy'),
   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):
 def index(request):
   hue_collections = SearchController(request.user).get_search_collections()
   hue_collections = SearchController(request.user).get_search_collections()
   collection_id = request.GET.get('collection')
   collection_id = request.GET.get('collection')
-  
+
   if not hue_collections or not collection_id:
   if not hue_collections or not collection_id:
     if request.user.is_superuser:
     if request.user.is_superuser:
       return admin_collections(request, True)
       return admin_collections(request, True)
@@ -61,7 +61,7 @@ def index(request):
   return render('search.mako', request, {
   return render('search.mako', request, {
     'collection': collection,
     'collection': collection,
     'query': query,
     '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",
                   {"size":12,"name":"Grid Results","id":"52f07188-f30f-1296-2450-f77e02e1a5c0","widgetType":"resultset-widget",
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
               "drops":["temp"],"klass":"card card-home card-column span10"}
               "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",
                   {"size":12,"name":"Grid Results","id":"52f07188-f30f-1296-2450-f77e02e1a5c0","widgetType":"resultset-widget",
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
                    "properties":{},"offset":0,"isLoading":True,"klass":"card card-widget span12"}]}],
               "drops":["temp"],"klass":"card card-home card-column span10"}
               "drops":["temp"],"klass":"card card-home card-column span10"}
-         ] 
+         ]
      }),
      }),
   })
   })
 
 
 
 
 def search(request):
 def search(request):
-  response = {}  
-  
+  response = {}
+
   collection = json.loads(request.POST.get('collection', '{}'))
   collection = json.loads(request.POST.get('collection', '{}'))
   query = json.loads(request.POST.get('query', '{}'))
   query = json.loads(request.POST.get('query', '{}'))
   # todo: remove the selected histo facet if multiq
   # todo: remove the selected histo facet if multiq
 
 
   if collection['id']:
   if collection['id']:
     hue_collection = Collection.objects.get(id=collection['id']) # TODO perms
     hue_collection = Collection.objects.get(id=collection['id']) # TODO perms
-    
+
   if collection:
   if collection:
-    try:      
+    try:
       response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
       response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
       response = augment_solr_response(response, collection, query)
       response = augment_solr_response(response, collection, query)
     except RestException, e:
     except RestException, e:
@@ -136,7 +136,7 @@ def search(request):
         response['error'] = force_unicode(str(e))
         response['error'] = force_unicode(str(e))
     except Exception, e:
     except Exception, e:
       raise PopupException(e, title=_('Error while accessing Solr'))
       raise PopupException(e, title=_('Error while accessing Solr'))
-      
+
       response['error'] = force_unicode(str(e))
       response['error'] = force_unicode(str(e))
   else:
   else:
     response['error'] = _('There is no collection to search.')
     response['error'] = _('There is no collection to search.')
@@ -149,13 +149,13 @@ def search(request):
 
 
 @allow_admin_only
 @allow_admin_only
 def save(request):
 def save(request):
-  response = {'status': -1}  
-  
+  response = {'status': -1}
+
   collection = json.loads(request.POST.get('collection', '{}')) # TODO perms
   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
   collection['template']['extracode'] = escape(collection['template']['extracode']) # Escape HTML
-  
+
   if collection:
   if collection:
     if collection['id']:
     if collection['id']:
       hue_collection = Collection.objects.get(id=collection['id'])
       hue_collection = Collection.objects.get(id=collection['id'])
@@ -180,14 +180,14 @@ def download(request):
   try:
   try:
     file_format = 'csv' if 'csv' in request.POST else 'xls' if 'xls' in request.POST else 'json'
     file_format = 'csv' if 'csv' in request.POST else 'xls' if 'xls' in request.POST else 'json'
     response = search(request)
     response = search(request)
-    
+
     if file_format == 'json':
     if file_format == 'json':
       mimetype = 'application/json'
       mimetype = 'application/json'
       json_docs = json.dumps(json.loads(response.content)['response']['docs'])
       json_docs = json.dumps(json.loads(response.content)['response']['docs'])
       resp = HttpResponse(json_docs, mimetype=mimetype)
       resp = HttpResponse(json_docs, mimetype=mimetype)
       resp['Content-Disposition'] = 'attachment; filename=%s.%s' % ('query_result', file_format)
       resp['Content-Disposition'] = 'attachment; filename=%s.%s' % ('query_result', file_format)
-      return resp    
-    
+      return resp
+
     return export_download(json.loads(response.content), file_format)
     return export_download(json.loads(response.content), file_format)
   except Exception, e:
   except Exception, e:
     raise PopupException(_("Could not download search results: %s") % 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")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def index_fields_dynamic(request):  
+def index_fields_dynamic(request):
   result = {'status': -1, 'message': 'Error'}
   result = {'status': -1, 'message': 'Error'}
-  
+
   try:
   try:
     name = request.POST['name']
     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)
     dynamic_fields = SolrApi(SOLR_URL.get(), request.user).luke(hue_collection.name)
 
 
     result['message'] = ''
     result['message'] = ''
     result['fields'] = [Collection._make_field(name, properties)
     result['fields'] = [Collection._make_field(name, properties)
                         for name, properties in dynamic_fields['fields'].iteritems() if 'dynamicBase' in 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]
                                           for name, properties in dynamic_fields['fields'].iteritems() if 'dynamicBase' in properties]
     result['status'] = 0
     result['status'] = 0
   except Exception, e:
   except Exception, e:
@@ -288,13 +288,13 @@ def index_fields_dynamic(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def get_document(request):  
+def get_document(request):
   result = {'status': -1, 'message': 'Error'}
   result = {'status': -1, 'message': 'Error'}
 
 
   try:
   try:
     collection = json.loads(request.POST.get('collection', '{}'))
     collection = json.loads(request.POST.get('collection', '{}'))
     doc_id = request.POST.get('id')
     doc_id = request.POST.get('id')
-            
+
     if doc_id:
     if doc_id:
       result['doc'] = SolrApi(SOLR_URL.get(), request.user).get(collection['name'], doc_id)
       result['doc'] = SolrApi(SOLR_URL.get(), request.user).get(collection['name'], doc_id)
       result['status'] = 0
       result['status'] = 0
@@ -302,14 +302,14 @@ def get_document(request):
     else:
     else:
       result['message'] = _('This document does not have any index id.')
       result['message'] = _('This document does not have any index id.')
       result['status'] = 1
       result['status'] = 1
-    
+
   except Exception, e:
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
     result['message'] = unicode(str(e), "utf8")
 
 
   return HttpResponse(json.dumps(result), mimetype="application/json")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def get_timeline(request):  
+def get_timeline(request):
   result = {'status': -1, 'message': 'Error'}
   result = {'status': -1, 'message': 'Error'}
 
 
   try:
   try:
@@ -318,11 +318,11 @@ def get_timeline(request):
     facet = json.loads(request.POST.get('facet', '{}'))
     facet = json.loads(request.POST.get('facet', '{}'))
     qdata = json.loads(request.POST.get('qdata', '{}'))
     qdata = json.loads(request.POST.get('qdata', '{}'))
     multiQ = request.POST.get('multiQ', 'query')
     multiQ = request.POST.get('multiQ', 'query')
-    
+
     if multiQ == 'query':
     if multiQ == 'query':
-      label = qdata['q'] 
+      label = qdata['q']
       query['qs'] = [qdata]
       query['qs'] = [qdata]
-    elif facet['type'] == 'range':      
+    elif facet['type'] == 'range':
       _prop = filter(lambda prop: prop['from'] == qdata, facet['properties'])[0]
       _prop = filter(lambda prop: prop['from'] == qdata, facet['properties'])[0]
       label = '%(from)s - %(to)s ' % _prop
       label = '%(from)s - %(to)s ' % _prop
       facet_id = facet['id']
       facet_id = facet['id']
@@ -336,16 +336,16 @@ def get_timeline(request):
       # Only care about our current field:value filter
       # Only care about our current field:value filter
       for fq in query['fqs']:
       for fq in query['fqs']:
         if fq['id'] == facet_id:
         if fq['id'] == facet_id:
-          fq['filter'] = [qdata] 
-      
+          fq['filter'] = [qdata]
+
     # Remove other facets from collection for speed
     # Remove other facets from collection for speed
     collection['facets'] = filter(lambda f: f['widgetType'] == 'histogram-widget', collection['facets'])
     collection['facets'] = filter(lambda f: f['widgetType'] == 'histogram-widget', collection['facets'])
-    
+
     response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
     response = SolrApi(SOLR_URL.get(), request.user).query(collection, query)
     response = augment_solr_response(response, collection, query)
     response = augment_solr_response(response, collection, query)
-  
+
     label += ' (%s) ' % response['response']['numFound']
     label += ' (%s) ' % response['response']['numFound']
-  
+
     result['series'] = {'label': label, 'counts': response['normalized_facets'][0]['counts']}
     result['series'] = {'label': label, 'counts': response['normalized_facets'][0]['counts']}
     result['status'] = 0
     result['status'] = 0
     result['message'] = ''
     result['message'] = ''
@@ -355,12 +355,12 @@ def get_timeline(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def new_facet(request):  
+def new_facet(request):
   result = {'status': -1, 'message': 'Error'}
   result = {'status': -1, 'message': 'Error'}
-  
+
   try:
   try:
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
-    
+
     facet_id = request.POST['id']
     facet_id = request.POST['id']
     facet_label = request.POST['label']
     facet_label = request.POST['label']
     facet_field = request.POST['field']
     facet_field = request.POST['field']
@@ -385,23 +385,23 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     'isDate': False,
     'isDate': False,
     'andUp': False,  # Not used yet
     'andUp': False,  # Not used yet
   }
   }
-  
+
   solr_api = SolrApi(SOLR_URL.get(), user)
   solr_api = SolrApi(SOLR_URL.get(), user)
   range_properties = _new_range_facet(solr_api, collection, facet_field, widget_type)
   range_properties = _new_range_facet(solr_api, collection, facet_field, widget_type)
-                        
+
   if range_properties:
   if range_properties:
     facet_type = 'range'
     facet_type = 'range'
-    properties.update(range_properties)       
+    properties.update(range_properties)
   elif widget_type == 'hit-widget':
   elif widget_type == 'hit-widget':
-    facet_type = 'query'      
+    facet_type = 'query'
   else:
   else:
-    facet_type = 'field'        
-      
+    facet_type = 'field'
+
   if widget_type == 'map-widget':
   if widget_type == 'map-widget':
     properties['scope'] = 'world'
     properties['scope'] = 'world'
     properties['mincount'] = 1
     properties['mincount'] = 1
-    properties['limit'] = 100     
-    
+    properties['limit'] = 100
+
   return {
   return {
     'id': facet_id,
     'id': facet_id,
     'label': facet_label,
     'label': facet_label,
@@ -411,23 +411,23 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     'properties': properties
     'properties': properties
   }
   }
 
 
-def get_range_facet(request):  
+def get_range_facet(request):
   result = {'status': -1, 'message': ''}
   result = {'status': -1, 'message': ''}
 
 
   try:
   try:
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
     collection = json.loads(request.POST.get('collection', '{}')) # Perms
     facet = json.loads(request.POST.get('facet', '{}'))
     facet = json.loads(request.POST.get('facet', '{}'))
     action = request.POST.get('action', 'select')
     action = request.POST.get('action', 'select')
-            
+
     solr_api = SolrApi(SOLR_URL.get(), request.user)
     solr_api = SolrApi(SOLR_URL.get(), request.user)
 
 
     if action == 'select':
     if action == 'select':
       properties = _guess_gap(solr_api, collection, facet, facet['properties']['start'], facet['properties']['end'])
       properties = _guess_gap(solr_api, collection, facet, facet['properties']['start'], facet['properties']['end'])
     else:
     else:
       properties = _zoom_range_facet(solr_api, collection, facet)
       properties = _zoom_range_facet(solr_api, collection, facet)
-            
+
     result['properties'] = properties
     result['properties'] = properties
-    result['status'] = 0      
+    result['status'] = 0
 
 
   except Exception, e:
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
     result['message'] = unicode(str(e), "utf8")
@@ -435,17 +435,17 @@ def get_range_facet(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def get_collection(request):  
+def get_collection(request):
   result = {'status': -1, 'message': ''}
   result = {'status': -1, 'message': ''}
 
 
   try:
   try:
     name = request.POST['name']
     name = request.POST['name']
-            
+
     collection = Collection(name=name, label=name)
     collection = Collection(name=name, label=name)
     collection_json = collection.get_c(request.user)
     collection_json = collection.get_c(request.user)
-            
+
     result['collection'] = json.loads(collection_json)
     result['collection'] = json.loads(collection_json)
-    result['status'] = 0      
+    result['status'] = 0
 
 
   except Exception, e:
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
     result['message'] = unicode(str(e), "utf8")
@@ -453,12 +453,12 @@ def get_collection(request):
   return HttpResponse(json.dumps(result), mimetype="application/json")
   return HttpResponse(json.dumps(result), mimetype="application/json")
 
 
 
 
-def get_collections(request):  
+def get_collections(request):
   result = {'status': -1, 'message': ''}
   result = {'status': -1, 'message': ''}
 
 
-  try:           
+  try:
     result['collection'] = SearchController(request.user).get_all_indexes()
     result['collection'] = SearchController(request.user).get_all_indexes()
-    result['status'] = 0      
+    result['status'] = 0
 
 
   except Exception, e:
   except Exception, e:
     result['message'] = unicode(str(e), "utf8")
     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>
 <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>
                 <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>
                     <p>This feature lets you search interactively:</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><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>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>
                 </p>
-                
+
 
 
 <h2>Solr Search Installation and Configuration</h2>
 <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["defaultFill"] = HueColors.LIGHT_BLUE;
       _fills["selected"] = HueColors.DARK_BLUE;
       _fills["selected"] = HueColors.DARK_BLUE;
       $(_data).each(function(cnt, item) {
       $(_data).each(function(cnt, item) {
-    	var _place = item.label.toUpperCase();
+      var _place = item.label.toUpperCase();
         if (_place != null){
         if (_place != null){
           _mapdata[_place] = {
           _mapdata[_place] = {
             fillKey: "selected",
             fillKey: "selected",
@@ -211,10 +211,10 @@ ko.bindingHandlers.mapChart = {
           selectedFillColor: HueColors.DARKER_BLUE,
           selectedFillColor: HueColors.DARKER_BLUE,
           selectedBorderColor: HueColors.DARKER_BLUE,
           selectedBorderColor: HueColors.DARKER_BLUE,
           popupTemplate: function(geography, data) {
           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>'
             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
               // Issue #140
               xTicks
               xTicks
                 .selectAll("text")
                 .selectAll("text")
-                .attr('transform', function(d,i,j) { 
+                .attr('transform', function(d,i,j) {
                     return  getTranslate(0, (j % 2 == 0 ? staggerUp : staggerDown));
                     return  getTranslate(0, (j % 2 == 0 ? staggerUp : staggerDown));
                   });
                   });
 
 
@@ -297,13 +297,13 @@ nv.models.growingMultiBarChart = function() {
               .selectAll('.tick text')
               .selectAll('.tick text')
               .attr('transform', 'rotate(' + rotateLabels + ' 0,0)')
               .attr('transform', 'rotate(' + rotateLabels + ' 0,0)')
               .style('text-anchor', rotateLabels > 0 ? 'start' : 'end');
               .style('text-anchor', rotateLabels > 0 ? 'start' : 'end');
-          
+
           g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
           g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
               .style('opacity', 1);
               .style('opacity', 1);
       }
       }
 
 
 
 
-      if (showYAxis) {      
+      if (showYAxis) {
           yAxis
           yAxis
             .scale(y)
             .scale(y)
             .ticks( availableHeight / 36 )
             .ticks( availableHeight / 36 )
@@ -322,7 +322,7 @@ nv.models.growingMultiBarChart = function() {
       // Event Handling/Dispatching (in chart's scope)
       // Event Handling/Dispatching (in chart's scope)
       //------------------------------------------------------------
       //------------------------------------------------------------
 
 
-      legend.dispatch.on('stateChange', function(newState) { 
+      legend.dispatch.on('stateChange', function(newState) {
         state = newState;
         state = newState;
         dispatch.stateChange(state);
         dispatch.stateChange(state);
         chart.update();
         chart.update();
@@ -420,7 +420,7 @@ nv.models.growingMultiBarChart = function() {
    'id', 'stacked', 'stackOffset', 'delay', 'barColor','groupSpacing');
    'id', 'stacked', 'stackOffset', 'delay', 'barColor','groupSpacing');
 
 
   chart.options = nv.utils.optionsFunc.bind(chart);
   chart.options = nv.utils.optionsFunc.bind(chart);
-  
+
   chart.margin = function(_) {
   chart.margin = function(_) {
     if (!arguments.length) return margin;
     if (!arguments.length) return margin;
     margin.top    = typeof _.top    != 'undefined' ? _.top    : margin.top;
     margin.top    = typeof _.top    != 'undefined' ? _.top    : margin.top;
@@ -527,7 +527,7 @@ nv.models.growingMultiBarChart = function() {
     defaultState = _;
     defaultState = _;
     return chart;
     return chart;
   };
   };
-  
+
   chart.noData = function(_) {
   chart.noData = function(_) {
     if (!arguments.length) return noData;
     if (!arguments.length) return noData;
     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);
     self.size(self.size() + 1);
     $("#wdg_" + self.id()).trigger("resize");
     $("#wdg_" + self.id()).trigger("resize");
   }
   }
-  
+
   self.compress = function () {
   self.compress = function () {
     self.size(self.size() - 1);
     self.size(self.size() - 1);
     $("#wdg_" + self.id()).trigger("resize");
     $("#wdg_" + self.id()).trigger("resize");
@@ -113,7 +113,7 @@ var Widget = function (size, id, name, widgetType, properties, offset, loading)
   self.moveLeft = function () {
   self.moveLeft = function () {
     self.offset(self.offset() - 1);
     self.offset(self.offset() - 1);
   }
   }
-  
+
   self.moveRight = function () {
   self.moveRight = function () {
     self.offset(self.offset() + 1);
     self.offset(self.offset() + 1);
   }
   }
@@ -181,8 +181,8 @@ function setLayout(colSizes) {
 
 
 function loadLayout(viewModel, json_layout) {
 function loadLayout(viewModel, json_layout) {
   var _columns = [];
   var _columns = [];
-  
-  $(json_layout).each(function (cnt, json_col) { 
+
+  $(json_layout).each(function (cnt, json_col) {
     var _rows = [];
     var _rows = [];
     $(json_col.rows).each(function (rcnt, json_row) {
     $(json_col.rows).each(function (rcnt, json_row) {
       var row = new Row();
       var row = new Row();
@@ -206,10 +206,10 @@ var Query = function (vm, query) {
   self.qs = ko.mapping.fromJS(query.qs);
   self.qs = ko.mapping.fromJS(query.qs);
   self.fqs = ko.mapping.fromJS(query.fqs);
   self.fqs = ko.mapping.fromJS(query.fqs);
   self.start = ko.mapping.fromJS(query.start);
   self.start = ko.mapping.fromJS(query.start);
-  
+
   var defaultMultiqGroup = {'id': 'query', 'label': 'query'};
   var defaultMultiqGroup = {'id': 'query', 'label': 'query'};
   self.multiqs = ko.computed(function () { // List of widgets supporting multiqs
   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(
     return [defaultMultiqGroup].concat(
         $.map($.grep(self.fqs(), function(fq, i) {
         $.map($.grep(self.fqs(), function(fq, i) {
             return (fq.type() == 'field' || fq.type() == 'range') && (histogram_id == null || histogram_id.id() != fq.id());
             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) {
   self.getFacetFilter = function(widget_id) {
     var _fq = null;
     var _fq = null;
-    $.each(self.fqs(), function (index, fq) { 
+    $.each(self.fqs(), function (index, fq) {
       if (fq.id() == widget_id) {
       if (fq.id() == widget_id) {
         _fq = fq;
         _fq = fq;
         return false;
         return false;
@@ -244,19 +244,19 @@ var Query = function (vm, query) {
     }
     }
     return null;
     return null;
   });
   });
-  
+
   self.selectedMultiq.subscribe(function () { // To keep below the computed
   self.selectedMultiq.subscribe(function () { // To keep below the computed
     vm.search();
     vm.search();
   });
   });
-  
+
   self.addQ = function (data) {
   self.addQ = function (data) {
     self.qs.push(ko.mapping.fromJS({'q': ''}));
     self.qs.push(ko.mapping.fromJS({'q': ''}));
   };
   };
-  
+
   self.removeQ = function (query) {
   self.removeQ = function (query) {
     self.qs.remove(query);
     self.qs.remove(query);
   };
   };
-  
+
   self.toggleFacet = function (data) {
   self.toggleFacet = function (data) {
     var fq = self.getFacetFilter(data.widget_id);
     var fq = self.getFacetFilter(data.widget_id);
 
 
@@ -281,17 +281,17 @@ var Query = function (vm, query) {
         }
         }
       });
       });
     }
     }
-  
+
     vm.search();
     vm.search();
-  }  
-  
+  }
+
   self.selectRangeFacet = function (data) {
   self.selectRangeFacet = function (data) {
     if (data.force != undefined) {
     if (data.force != undefined) {
       self.removeFilter(ko.mapping.fromJS({'id': data.widget_id}));
       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) {
     if (fq == null) {
       self.fqs.push(ko.mapping.fromJS({
       self.fqs.push(ko.mapping.fromJS({
           'id': data.widget_id,
           'id': data.widget_id,
@@ -299,21 +299,21 @@ var Query = function (vm, query) {
           'filter': [data.from],
           'filter': [data.from],
           'properties': [{'from': data.from, 'to': data.to}],
           'properties': [{'from': data.from, 'to': data.to}],
           'type': 'range'
           'type': 'range'
-      }));    	
-    } else {    
+      }));      
+    } else {
       if (fq.filter().indexOf(data.from) > -1) { // Unselect
       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}));
           self.removeFilter(ko.mapping.fromJS({'id': data.widget_id}));
-    	}    	 
+      }      
       } else {
       } 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();
       vm.search();
     }
     }
   };
   };
-  
-  self.removeFilter = function (data) { 
+
+  self.removeFilter = function (data) {
     $.each(self.fqs(), function (index, fq) {
     $.each(self.fqs(), function (index, fq) {
-      if (fq.id() == data.id()) {          
+      if (fq.id() == data.id()) {
         self.fqs.remove(fq);
         self.fqs.remove(fq);
         // Also re-init range select widget
         // Also re-init range select widget
         var rangeWidget = vm.collection.getFacetById(fq.id());
         var rangeWidget = vm.collection.getFacetById(fq.id());
         if (rangeWidget != null && RANGE_SELECTABLE_WIDGETS.indexOf(rangeWidget.widgetType()) != -1 && fq.type() == 'range') {
         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;
         return false;
       }
       }
     });
     });
-  }; 
-  
+  };
+
   self.paginate = function (direction) {
   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(){
   self.template.rows.subscribe(function(){
-	vm.search();
+  vm.search();
   });
   });
   self.template.rows.extend({rateLimit: {timeout: 1500, method: "notifyWhenChangesStop"}});
   self.template.rows.extend({rateLimit: {timeout: 1500, method: "notifyWhenChangesStop"}});
 
 
@@ -411,7 +411,7 @@ var Collection = function (vm, collection) {
 
 
   self.availableFacetFields = ko.computed(function() {
   self.availableFacetFields = ko.computed(function() {
     var facetFieldNames = $.map(self.facets(), function(facet) {
     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 $.grep(self.fields(), function(field) {
       return facetFieldNames.indexOf(field.name()) == -1;
       return facetFieldNames.indexOf(field.name()) == -1;
@@ -422,7 +422,7 @@ var Collection = function (vm, collection) {
 
 
   self.addFacet = function (facet_json) {
   self.addFacet = function (facet_json) {
     self.removeFacet(function(){return facet_json.widget_id});
     self.removeFacet(function(){return facet_json.widget_id});
-	  
+  
     $.post("/search/template/new_facet", {
     $.post("/search/template/new_facet", {
       "collection": ko.mapping.toJSON(self),
       "collection": ko.mapping.toJSON(self),
         "id": facet_json.widget_id,
         "id": facet_json.widget_id,
@@ -434,7 +434,7 @@ var Collection = function (vm, collection) {
           var facet = ko.mapping.fromJS(data.facet);
           var facet = ko.mapping.fromJS(data.facet);
           facet.field.subscribe(function() {
           facet.field.subscribe(function() {
             vm.search();
             vm.search();
-          });      
+          });
           self.facets.push(facet);
           self.facets.push(facet);
           vm.search();
           vm.search();
         } else {
         } else {
@@ -446,12 +446,12 @@ var Collection = function (vm, collection) {
   self.removeFacet = function (widget_id) {
   self.removeFacet = function (widget_id) {
     $.each(self.facets(), function (index, facet) {
     $.each(self.facets(), function (index, facet) {
       if (facet.id() == widget_id()) {
       if (facet.id() == widget_id()) {
-        self.facets.remove(facet); 
+        self.facets.remove(facet);
         return false;
         return false;
       }
       }
     });
     });
-  }  
-  
+  }
+
   self.getFacetById = function (facet_id) {
   self.getFacetById = function (facet_id) {
     var _facet = null;
     var _facet = null;
     $.each(self.facets(), function (index, facet) {
     $.each(self.facets(), function (index, facet) {
@@ -473,18 +473,18 @@ var Collection = function (vm, collection) {
     });
     });
     return _facet;
     return _facet;
   }
   }
-  
+
   self.getHistogramFacet = function () { // Should do multi histogram
   self.getHistogramFacet = function () { // Should do multi histogram
     return self.getFacetByType('histogram-widget');
     return self.getFacetByType('histogram-widget');
   }
   }
-  
+
   self.template.fields = ko.computed(function () {
   self.template.fields = ko.computed(function () {
     var _fields = [];
     var _fields = [];
     $.each(self.template.fieldsAttributes(), function (index, field) {
     $.each(self.template.fieldsAttributes(), function (index, field) {
       var position = self.template.fieldsSelected.indexOf(field.name());
       var position = self.template.fieldsSelected.indexOf(field.name());
       if (position != -1) {
       if (position != -1) {
         _fields[position] = field;
         _fields[position] = field;
-      }      
+      }
     });
     });
     return _fields;
     return _fields;
   });
   });
@@ -497,7 +497,7 @@ var Collection = function (vm, collection) {
         return false;
         return false;
       }
       }
     });
     });
-    return _field;    
+    return _field;
   };
   };
 
 
   self.template.fieldsModalFilter = ko.observable(""); // For UI
   self.template.fieldsModalFilter = ko.observable(""); // For UI
@@ -523,7 +523,7 @@ var Collection = function (vm, collection) {
   });
   });
   self.template.availableWidgetFields = ko.computed(function() {
   self.template.availableWidgetFields = ko.computed(function() {
     if (self.template.fieldsModalType() == 'histogram-widget') {
     if (self.template.fieldsModalType() == 'histogram-widget') {
-      return vm.availableDateFields();	
+      return vm.availableDateFields();  
     }
     }
     else if (self.template.fieldsModalType() == 'line-widget') {
     else if (self.template.fieldsModalType() == 'line-widget') {
       return vm.availableNumberFields();
       return vm.availableNumberFields();
@@ -533,11 +533,11 @@ var Collection = function (vm, collection) {
     }
     }
   });
   });
   self.template.availableWidgetFieldsNames = ko.computed(function() {
   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) {
   self.template.fieldsModalFilter.subscribe(function(value) {
     var _fields = [];
     var _fields = [];
     var _availableFields = self.template.availableWidgetFields();
     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
   self.switchCollection = function() { // Long term would be to reload the page
     $.post("/search/get_collection", {
     $.post("/search/get_collection", {
         name: self.name()
         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) {
   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) {
   function syncArray(currentObservable, newJson, isDynamic) {
     // Get names of fields
     // Get names of fields
     var _currentFieldsNames = $.map(
     var _currentFieldsNames = $.map(
         $.grep(currentObservable(), function(field) {
         $.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(
     var _newFieldsNames = $.map(
-    	$.grep(newJson, function(field) {
-    	  return field.isDynamic == isDynamic;
+      $.grep(newJson, function(field) {
+        return field.isDynamic == isDynamic;
         }), function(field) {
         }), function(field) {
-    	return field.name;
+      return field.name;
     });
     });
-      
+
     var _toDelete = diff(_currentFieldsNames, _newFieldsNames);
     var _toDelete = diff(_currentFieldsNames, _newFieldsNames);
     var _toAdd = diff(_newFieldsNames, _currentFieldsNames);
     var _toAdd = diff(_newFieldsNames, _currentFieldsNames);
 
 
@@ -601,33 +601,33 @@ var Collection = function (vm, collection) {
     });
     });
     // New fields
     // New fields
     $.each(newJson, function(index, field) {
     $.each(newJson, function(index, field) {
-  	 if (_toAdd.indexOf(field.name) != -1) {
+     if (_toAdd.indexOf(field.name) != -1) {
         currentObservable.push(ko.mapping.fromJS(field));
         currentObservable.push(ko.mapping.fromJS(field));
       }
       }
     });
     });
-  }  
-  
+  }
+
   self.syncFields = function() {
   self.syncFields = function() {
     $.post("/search/get_collection", {
     $.post("/search/get_collection", {
         name: self.name()
         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 () {
   self.syncDynamicFields = function () {
     $.post("/search/index/fields/dynamic", {
     $.post("/search/index/fields/dynamic", {
-    	name: self.name()
+      name: self.name()
       }, function (data) {
       }, function (data) {
         if (data.status == 0) {
         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) {});
     }).fail(function (xhr, textStatus, errorThrown) {});
   };
   };
@@ -638,47 +638,47 @@ var Collection = function (vm, collection) {
     } else if (template_field.sort.direction() == 'desc') {
     } else if (template_field.sort.direction() == 'desc') {
       template_field.sort.direction('asc');
       template_field.sort.direction('asc');
     } else {
     } else {
-      template_field.sort.direction(null); 
+      template_field.sort.direction(null);
     }
     }
     $(document).trigger("setResultsHeight");
     $(document).trigger("setResultsHeight");
     vm.search();
     vm.search();
   };
   };
-  
+
   self.toggleSortFacet = function (facet_field, event) {
   self.toggleSortFacet = function (facet_field, event) {
     if (facet_field.properties.sort() == 'desc') {
     if (facet_field.properties.sort() == 'desc') {
       facet_field.properties.sort('asc');
       facet_field.properties.sort('asc');
     } else {
     } else {
       facet_field.properties.sort('desc');
       facet_field.properties.sort('desc');
-    }   
-   
+    }
+
     $(event.target).button('loading');
     $(event.target).button('loading');
     vm.search();
     vm.search();
   };
   };
 
 
   self.toggleRangeFacet = function (facet_field, event) {
   self.toggleRangeFacet = function (facet_field, event) {
     vm.query.removeFilter(ko.mapping.fromJS({'id': facet_field.id})); // Reset filter query
     vm.query.removeFilter(ko.mapping.fromJS({'id': facet_field.id})); // Reset filter query
- 
+
     if (facet_field.type() == 'field') {
     if (facet_field.type() == 'field') {
        facet_field.type('range');
        facet_field.type('range');
      } else if (facet_field.type() == 'range') {
      } else if (facet_field.type() == 'range') {
        facet_field.type('field')
        facet_field.type('field')
      }
      }
-   
+
     $(event.target).button('loading');
     $(event.target).button('loading');
     vm.search();
     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);
     var facet = self.getFacetById(data.widget_id);
-  
+
     facet.properties.start(data.from);
     facet.properties.start(data.from);
     facet.properties.end(data.to);
     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});
     vm.query.selectRangeFacet({widget_id: data.widget_id, from: data.from, to: data.to, cat: data.cat, no_refresh: true, force: true});
-  
+
     $.ajax({
     $.ajax({
       type: "POST",
       type: "POST",
-      url: "/search/get_range_facet",    
+      url: "/search/get_range_facet",
       data: {
       data: {
         collection: ko.mapping.toJSON(self),
         collection: ko.mapping.toJSON(self),
         facet: ko.mapping.toJSON(facet),
         facet: ko.mapping.toJSON(facet),
@@ -690,20 +690,20 @@ var Collection = function (vm, collection) {
         }
         }
       },
       },
       async: false
       async: false
-    });  
-  
+    });
+
     vm.search();
     vm.search();
   }
   }
 
 
-  self.timeLineZoom = function (facet_json) { 
+  self.timeLineZoom = function (facet_json) {
     var facet = self.getFacetById(facet_json.id);
     var facet = self.getFacetById(facet_json.id);
 
 
     facet.properties.start(facet.from);
     facet.properties.start(facet.from);
     facet.properties.end(facet.to);
     facet.properties.end(facet.to);
-  
+
     $.ajax({
     $.ajax({
       type: "POST",
       type: "POST",
-      url: "/search/get_range_facet",    
+      url: "/search/get_range_facet",
       data: {
       data: {
         collection: ko.mapping.toJSON(self),
         collection: ko.mapping.toJSON(self),
         facet: ko.mapping.toJSON(facet),
         facet: ko.mapping.toJSON(facet),
@@ -714,7 +714,7 @@ var Collection = function (vm, collection) {
           facet.properties.start(data.properties.start);
           facet.properties.start(data.properties.start);
           facet.properties.end(data.properties.end);
           facet.properties.end(data.properties.end);
           facet.properties.gap(data.properties.gap);
           facet.properties.gap(data.properties.gap);
-          
+
           var fq = vm.query.getFacetFilter(facet_json.id);
           var fq = vm.query.getFacetFilter(facet_json.id);
           if (fq != null) {
           if (fq != null) {
             fq.properties()[0].from(data.properties.start);
             fq.properties()[0].from(data.properties.start);
@@ -723,11 +723,11 @@ var Collection = function (vm, collection) {
         }
         }
       },
       },
       async: false
       async: false
-    });  
-  
+    });
+
     vm.search();
     vm.search();
   }
   }
-  
+
   self.translateSelectedField = function (index, direction) {
   self.translateSelectedField = function (index, direction) {
     var array = self.template.fieldsSelected();
     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.template.fieldsSelected.splice(index, 2, array[index + 1], array[index]);
     }
     }
   };
   };
-  
+
   self.upDownFacetLimit = function (facet_id, direction) {
   self.upDownFacetLimit = function (facet_id, direction) {
     var facet = self.getFacetById(facet_id);
     var facet = self.getFacetById(facet_id);
-    
+
     if (facet.properties.prevLimit == undefined) {
     if (facet.properties.prevLimit == undefined) {
       facet.properties.prevLimit = facet.properties.limit();
       facet.properties.prevLimit = facet.properties.limit();
     }
     }
-    
+
     if (direction == 'up') {
     if (direction == 'up') {
       facet.properties.limit(facet.properties.limit() + 10);
       facet.properties.limit(facet.properties.limit() + 10);
     } else {
     } else {
       facet.properties.limit(facet.properties.limit() - 10);
       facet.properties.limit(facet.properties.limit() - 10);
     }
     }
-    
+
     vm.search();
     vm.search();
   };
   };
 };
 };
@@ -761,29 +761,29 @@ var NewTemplate = function (vm, initial) {
   self.collections = ko.mapping.fromJS(initial.collections);
   self.collections = ko.mapping.fromJS(initial.collections);
   self.layout = initial.layout;
   self.layout = initial.layout;
   self.inited = ko.observable(self.collections().length > 0); // No collection if not a new dashboard
   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) {
     if (initial.autoLoad) {
-	  magicLayout(vm);
-    }   
+      magicLayout(vm);
+    }
   };
   };
-  
+
   self.syncCollections = function () {
   self.syncCollections = function () {
     $.post("/search/get_collections", {
     $.post("/search/get_collections", {
     },function (data) {
     },function (data) {
       if (data.status == 0) {
       if (data.status == 0) {
-    	// Sync new and old names
+      // Sync new and old names
         $.each(data.collection, function(index, name) {
         $.each(data.collection, function(index, name) {
           if (self.collections.indexOf(name) == -1) {
           if (self.collections.indexOf(name) == -1) {
             self.collections.push(name);
             self.collections.push(name);
@@ -793,8 +793,8 @@ var NewTemplate = function (vm, initial) {
           if (data.collection.indexOf(collection) == -1) {
           if (data.collection.indexOf(collection) == -1) {
             self.collections.remove(collection);
             self.collections.remove(collection);
           }
           }
-        });        
-      } 
+        });
+      }
       else {
       else {
         $(document).trigger("error", data.message);
         $(document).trigger("error", data.message);
       }
       }
@@ -803,7 +803,7 @@ var NewTemplate = function (vm, initial) {
     }).done(function() {
     }).done(function() {
       self.inited(true);
       self.inited(true);
     });
     });
-  };   
+  };
 };
 };
 
 
 
 
@@ -827,16 +827,16 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.norm_facets = ko.computed(function () {
   self.norm_facets = ko.computed(function () {
     return self.response().normalized_facets;
     return self.response().normalized_facets;
   });
   });
-  self.getFacetFromQuery = function (facet_id) {  
+  self.getFacetFromQuery = function (facet_id) {
     var _facet = null;
     var _facet = null;
     if (self.norm_facets() !== undefined) {
     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) {
         if (norm_facet.id == facet_id) {
           _facet = norm_facet;
           _facet = norm_facet;
-        }      
+        }
       });
       });
     }
     }
-    return _facet;    
+    return _facet;
   };
   };
   self.toggledGridlayoutResultChevron = ko.observable(false);
   self.toggledGridlayoutResultChevron = ko.observable(false);
   self.enableGridlayoutResultChevron = function() {
   self.enableGridlayoutResultChevron = function() {
@@ -855,7 +855,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     self.isEditing(!self.isEditing());
     self.isEditing(!self.isEditing());
   };
   };
   self.isRetrievingResults = ko.observable(false);
   self.isRetrievingResults = ko.observable(false);
-      
+
   self.draggableHit = ko.observable(new Widget(12, UUID(), "Hit Count", "hit-widget"));
   self.draggableHit = ko.observable(new Widget(12, UUID(), "Hit Count", "hit-widget"));
   self.draggableFacet = ko.observable(new Widget(12, UUID(), "Facet", "facet-widget"));
   self.draggableFacet = ko.observable(new Widget(12, UUID(), "Facet", "facet-widget"));
   self.draggableResultset = ko.observable(new Widget(12, UUID(), "Grid Results", "resultset-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.draggableMap = ko.observable(new Widget(12, UUID(), "Map", "map-widget"));
   self.draggableLine = ko.observable(new Widget(12, UUID(), "Line Chart", "line-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.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() {
   self.availableDateFields = ko.computed(function() {
     return $.grep(self.collection.availableFacetFields(), function(field) { return DATE_TYPES.indexOf(field.type()) != -1; });
     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() {
   self.availableNumberFields = ko.computed(function() {
     return $.grep(self.collection.availableFacetFields(), function(field) { return NUMBER_TYPES.indexOf(field.type()) != -1; });
     return $.grep(self.collection.availableFacetFields(), function(field) { return NUMBER_TYPES.indexOf(field.type()) != -1; });
   });
   });
-  
+
   function getWidgets(equalsTo) {
   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() {
   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() {
   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() {
   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() {
   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() {
   self.availableDraggableChart = ko.computed(function() {
     return self.collection.availableFacetFields().length > 0;
     return self.collection.availableFacetFields().length > 0;
   });
   });
-  
+
   self.init = function (callback) {
   self.init = function (callback) {
-	self.initial.init();
-	self.collection.syncFields();
+  self.initial.init();
+  self.collection.syncFields();
     self.search(callback);
     self.search(callback);
   }
   }
-  
+
   self.searchBtn = function () {
   self.searchBtn = function () {
     self.query.start(0);
     self.query.start(0);
     self.search();
     self.search();
@@ -910,22 +910,22 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.search = function (callback) {
   self.search = function (callback) {
     self.isRetrievingResults(true);
     self.isRetrievingResults(true);
     $(".jHueNotify").hide();
     $(".jHueNotify").hide();
-    
-    // Multi queries    
+
+    // Multi queries
     var multiQs = [];
     var multiQs = [];
     var multiQ = self.query.getMultiq();
     var multiQ = self.query.getMultiq();
-    
+
     if (multiQ != null) {
     if (multiQ != null) {
       var facet = {};
       var facet = {};
       var queries = [];
       var queries = [];
-      
+
       if (multiQ == 'query') {
       if (multiQ == 'query') {
         queries = self.query.qs();
         queries = self.query.qs();
       } else {
       } else {
         facet = self.query.getFacetFilter(self.query.selectedMultiq());
         facet = self.query.getFacetFilter(self.query.selectedMultiq());
-        queries = facet.filter();       
+        queries = facet.filter();
       }
       }
-      
+
       multiQs = $.map(queries, function(qdata) {
       multiQs = $.map(queries, function(qdata) {
         return $.post("/search/get_timeline", {
         return $.post("/search/get_timeline", {
             collection: ko.mapping.toJSON(self.collection),
             collection: ko.mapping.toJSON(self.collection),
@@ -934,7 +934,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
             qdata: ko.mapping.toJSON(qdata),
             qdata: ko.mapping.toJSON(qdata),
             multiQ: multiQ
             multiQ: multiQ
           }, function (data) {return data});
           }, function (data) {return data});
-      });              
+      });
     }
     }
 
 
     $.when.apply($, [
     $.when.apply($, [
@@ -959,17 +959,17 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
               var fields = self.collection.template.fieldsSelected();
               var fields = self.collection.template.fieldsSelected();
               // Display selected fields or whole json document
               // Display selected fields or whole json document
               if (fields.length != 0) {
               if (fields.length != 0) {
-                $.each(self.collection.template.fieldsSelected(), function (index, field) {  
+                $.each(self.collection.template.fieldsSelected(), function (index, field) {
                   row.push(item[field]);
                   row.push(item[field]);
                 });
                 });
               } else {
               } else {
-                row.push(ko.mapping.toJSON(item)); 
+                row.push(ko.mapping.toJSON(item));
               }
               }
               var doc = {
               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);
               self.results.push(doc);
             });
             });
@@ -991,7 +991,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     .done(function() {
     .done(function() {
       if (arguments[0] instanceof Array) { // If multi queries
       if (arguments[0] instanceof Array) { // If multi queries
         var histoFacetId = self.collection.getHistogramFacet().id();
         var histoFacetId = self.collection.getHistogramFacet().id();
-        var histoFacet = self.getFacetFromQuery(histoFacetId);  
+        var histoFacet = self.getFacetFromQuery(histoFacetId);
         for (var i = 1; i < arguments.length; i++) {
         for (var i = 1; i < arguments.length; i++) {
           histoFacet.extraSeries.push(arguments[i][0]['series']);
           histoFacet.extraSeries.push(arguments[i][0]['series']);
         }
         }
@@ -1046,12 +1046,12 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       id: doc.id
       id: doc.id
     }, function (data) {
     }, function (data) {
       if (data.status == 0) {
       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) {
       else if (data.status == 1) {
         $(document).trigger("info", data.message);
         $(document).trigger("info", data.message);
@@ -1062,8 +1062,8 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     }).fail(function (xhr, textStatus, errorThrown) {
     }).fail(function (xhr, textStatus, errorThrown) {
       $(document).trigger("error", xhr.responseText);
       $(document).trigger("error", xhr.responseText);
     });
     });
-  };  
-  
+  };
+
 
 
   self.save = function () {
   self.save = function () {
     $.post("/search/save", {
     $.post("/search/save", {

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

@@ -154,7 +154,7 @@ function fixTemplateDotsAndFunctionNames(template) {
       }
       }
       if (tag.indexOf(".") > -1) {
       if (tag.indexOf(".") > -1) {
         _mustacheTmpl = _mustacheTmpl.replace(tag, tag.replace(/\./gi, "_"))
         _mustacheTmpl = _mustacheTmpl.replace(tag, tag.replace(/\./gi, "_"))
-      }      
+      }
     });
     });
     _mustacheTmpl = _mustacheTmpl.replace(/\{\{(.+?)\}\}/g, "{{{$1}}}");
     _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-
 <!-- 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.
 see there the content will show up.
 
 
 <img src="img/ico/construction.png"> This line will appear at the top-
 <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="AED" rate="3.672955" comment="U.A.E. Dirham" />
     <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
     <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
     <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
     <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
-    
+
     <!-- Cross-rates for some common currencies -->
     <!-- 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>
   </rates>
 </currencyConfig>
 </currencyConfig>

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

@@ -29,10 +29,10 @@
   <doc id="2" />
   <doc id="2" />
   <doc id="3" />
   <doc id="3" />
  </query>
  </query>
- 
+
  <query text="ipod">
  <query text="ipod">
    <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
    <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
    <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
    <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
  </query>
  </query>
- 
+
 </elevate>
 </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
 # Set of Italian contractions for ElisionFilter
 # TODO: load this as a resource from the analyzer and sync it in build.xml
 # TODO: load this as a resource from the analyzer and sync it in build.xml
 c
 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
 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-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
 #  noun-proper-misc: miscellaneous proper nouns
@@ -26,7 +26,7 @@
 #  noun-proper-person: Personal names where the sub-classification is undefined
 #  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.
 #  given name; foreign names; names where the surname or given name is unknown.
 #  e.g. お市の方
 #  e.g. お市の方
 #名詞-固有名詞-人名-一般
 #名詞-固有名詞-人名-一般
@@ -50,28 +50,28 @@
 #  e.g. アジア, バルセロナ, 京都
 #  e.g. アジア, バルセロナ, 京都
 #名詞-固有名詞-地域-一般
 #名詞-固有名詞-地域-一般
 #
 #
-#  noun-proper-place-country: Country names. 
+#  noun-proper-place-country: Country names.
 #  e.g. 日本, オーストラリア
 #  e.g. 日本, オーストラリア
 #名詞-固有名詞-地域-国
 #名詞-固有名詞-地域-国
 #
 #
 #  noun-pronoun: Pronouns where the sub-classification is undefined
 #  noun-pronoun: Pronouns where the sub-classification is undefined
 #名詞-代名詞
 #名詞-代名詞
 #
 #
-#  noun-pronoun-misc: miscellaneous pronouns: 
+#  noun-pronoun-misc: miscellaneous pronouns:
 #  e.g. それ, ここ, あいつ, あなた, あちこち, いくつ, どこか, なに, みなさん, みんな, わたくし, われわれ
 #  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'.
 #  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,
 #  like adverbs. Nouns that represent amount or ratios and can be used adverbially,
 #  e.g. 金曜, 一月, 午後, 少量
 #  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 (する, できる, なさる, くださる)
 #  'suru' and related verbs (する, できる, なさる, くださる)
 #  e.g. インプット, 愛着, 悪化, 悪戦苦闘, 一安心, 下取り
 #  e.g. インプット, 愛着, 悪化, 悪戦苦闘, 一安心, 下取り
 #名詞-サ変接続
 #名詞-サ変接続
@@ -87,28 +87,28 @@
 #  noun-affix: noun affixes where the sub-classification is undefined
 #  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.
 #  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.
 #  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)").
 #  with the stem よう(だ) ("you(da)").
 #  e.g.  よう, やう, 様 (よう)
 #  e.g.  よう, やう, 様 (よう)
 #名詞-非自立-助動詞語幹
 #名詞-非自立-助動詞語幹
-#  
+#
 #  noun-affix-adjective-base: noun affixes that can connect to the indeclinable
 #  noun-affix-adjective-base: noun affixes that can connect to the indeclinable
 #  connection form な (aux "da").
 #  connection form な (aux "da").
 #  e.g. みたい, ふう
 #  e.g. みたい, ふう
@@ -117,8 +117,8 @@
 #  noun-special: special nouns where the sub-classification is undefined.
 #  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.
 #  form of inflectional words.
 #  e.g. そう
 #  e.g. そう
 #名詞-特殊-助動詞語幹
 #名詞-特殊-助動詞語幹
@@ -126,9 +126,9 @@
 #  noun-suffix: noun suffixes where the sub-classification is undefined.
 #  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
 #  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.
 #  接尾語 ("suffix") and is usually the last element in a compound noun.
 #  e.g. おき, かた, 方, 甲斐 (がい), がかり, ぎみ, 気味, ぐるみ, (~した) さ, 次第, 済 (ず) み,
 #  e.g. おき, かた, 方, 甲斐 (がい), がかり, ぎみ, 気味, ぐるみ, (~した) さ, 次第, 済 (ず) み,
 #       よう, (でき)っこ, 感, 観, 性, 学, 類, 面, 用
 #       よう, (でき)っこ, 感, 観, 性, 学, 類, 面, 用
@@ -139,23 +139,23 @@
 #  e.g. 君, 様, 著
 #  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.
 #  than other nouns.
 #  e.g. 町, 市, 県
 #  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").
 #  can appear before スル ("suru").
 #  e.g. 化, 視, 分け, 入り, 落ち, 買い
 #  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.
 #  conjunctive form of inflectional words.
 #  e.g. そう
 #  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").
 #  form of inflectional words and appear before the copula だ ("da").
 #  e.g. 的, げ, がち
 #  e.g. 的, げ, がち
 #名詞-接尾-形容動詞語幹
 #名詞-接尾-形容動詞語幹
@@ -164,8 +164,8 @@
 #  e.g. 後 (ご), 以後, 以降, 以前, 前後, 中, 末, 上, 時 (じ)
 #  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.
 #  to numbers.
 #  e.g. 個, つ, 本, 冊, パーセント, cm, kg, カ月, か国, 区画, 時間, 時半
 #  e.g. 個, つ, 本, 冊, パーセント, cm, kg, カ月, か国, 区画, 時間, 時半
 #名詞-接尾-助数詞
 #名詞-接尾-助数詞
@@ -174,18 +174,18 @@
 #  e.g. (楽し) さ, (考え) 方
 #  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.
 #  together.
 #  e.g. (日本) 対 (アメリカ), 対 (アメリカ), (3) 対 (5), (女優) 兼 (主婦)
 #  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.
 #  semantically verb-like.
 #  e.g. ごらん, ご覧, 御覧, 頂戴
 #  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").
 #  is いわく ("iwaku").
 #名詞-引用文字列
 #名詞-引用文字列
 #
 #
@@ -198,7 +198,7 @@
 #  prefix: unclassified prefixes
 #  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.
 #  excluding numerical expressions.
 #  e.g. お (水), 某 (氏), 同 (社), 故 (~氏), 高 (品質), お (見事), ご (立派)
 #  e.g. お (水), 某 (氏), 同 (社), 故 (~氏), 高 (品質), お (見事), ご (立派)
 #接頭詞-名詞接続
 #接頭詞-名詞接続
@@ -246,20 +246,20 @@
 #  adverb: unclassified adverbs
 #  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.
 #  modification is not possible.
 #  e.g. あいかわらず, 多分
 #  e.g. あいかわらず, 多分
 #副詞-一般
 #副詞-一般
 #
 #
-#  adverb-particle_conjunction: Adverbs that can be followed by の, は, に, 
+#  adverb-particle_conjunction: Adverbs that can be followed by の, は, に,
 #  な, する, だ, etc.
 #  な, する, だ, etc.
 #  e.g. こんなに, そんなに, あんなに, なにか, なんでも
 #  e.g. こんなに, そんなに, あんなに, なにか, なんでも
 #副詞-助詞類接続
 #副詞-助詞類接続
 #
 #
 #####
 #####
 #  adnominal: Words that only have noun-modifying forms.
 #  adnominal: Words that only have noun-modifying forms.
-#  e.g. この, その, あの, どの, いわゆる, なんらかの, 何らかの, いろんな, こういう, そういう, ああいう, 
-#       どういう, こんな, そんな, あんな, どんな, 大きな, 小さな, おかしな, ほんの, たいした, 
+#  e.g. この, その, あの, どの, いわゆる, なんらかの, 何らかの, いろんな, こういう, そういう, ああいう,
+#       どういう, こんな, そんな, あんな, どんな, 大きな, 小さな, おかしな, ほんの, たいした,
 #       「(, も) さる (ことながら)」, 微々たる, 堂々たる, 単なる, いかなる, 我が」「同じ, 亡き
 #       「(, も) さる (ことながら)」, 微々たる, 堂々たる, 単なる, いかなる, 我が」「同じ, 亡き
 #連体詞
 #連体詞
 #
 #
@@ -279,27 +279,27 @@
 #  e.g. から, が, で, と, に, へ, より, を, の, にて
 #  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,
 #  quotation marks, expressions of decisions from a meeting, reasons, judgements,
 #  conjectures, etc.
 #  conjectures, etc.
 #  e.g. ( だ) と (述べた.), ( である) と (して執行猶予...)
 #  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.
 #  like case particles.
 #  e.g. という, といった, とかいう, として, とともに, と共に, でもって, にあたって, に当たって, に当って,
 #  e.g. という, といった, とかいう, として, とともに, と共に, でもって, にあたって, に当たって, に当って,
-#       にあたり, に当たり, に当り, に当たる, にあたる, において, に於いて,に於て, における, に於ける, 
-#       にかけ, にかけて, にかんし, に関し, にかんして, に関して, にかんする, に関する, に際し, 
-#       に際して, にしたがい, に従い, に従う, にしたがって, に従って, にたいし, に対し, にたいして, 
+#       にあたり, に当たり, に当り, に当たる, にあたる, において, に於いて,に於て, における, に於ける,
+#       にかけ, にかけて, にかんし, に関し, にかんして, に関して, にかんする, に関する, に際し,
+#       に際して, にしたがい, に従い, に従う, にしたがって, に従って, にたいし, に対し, にたいして,
 #       に対して, にたいする, に対する, について, につき, につけ, につけて, につれ, につれて, にとって,
 #       に対して, にたいする, に対する, について, につき, につけ, につけて, につれ, につれて, にとって,
-#       にとり, にまつわる, によって, に依って, に因って, により, に依り, に因り, による, に依る, に因る, 
+#       にとり, にまつわる, によって, に依って, に因って, により, に依り, に因り, による, に依る, に因る,
 #       にわたって, にわたる, をもって, を以って, を通じ, を通じて, を通して, をめぐって, をめぐり, をめぐる,
 #       にわたって, にわたる, をもって, を以って, を通じ, を通じて, を通して, をめぐって, をめぐり, をめぐる,
 #       って-口語/, ちゅう-関西弁「という」/, (何) ていう (人)-口語/, っていう-口語/, といふ, とかいふ
 #       って-口語/, ちゅう-関西弁「という」/, (何) ていう (人)-口語/, っていう-口語/, といふ, とかいふ
 助詞-格助詞-連語
 助詞-格助詞-連語
 #
 #
 #  particle-conjunctive:
 #  particle-conjunctive:
-#  e.g. から, からには, が, けれど, けれども, けど, し, つつ, て, で, と, ところが, どころか, とも, ども, 
-#       ながら, なり, ので, のに, ば, ものの, や ( した), やいなや, (ころん) じゃ(いけない)-口語/, 
+#  e.g. から, からには, が, けれど, けれども, けど, し, つつ, て, で, と, ところが, どころか, とも, ども,
+#       ながら, なり, ので, のに, ば, ものの, や ( した), やいなや, (ころん) じゃ(いけない)-口語/,
 #       (行っ) ちゃ(いけない)-口語/, (言っ) たって (しかたがない)-口語/, (それがなく)ったって (平気)-口語/
 #       (行っ) ちゃ(いけない)-口語/, (言っ) たって (しかたがない)-口語/, (それがなく)ったって (平気)-口語/
 助詞-接続助詞
 助詞-接続助詞
 #
 #
@@ -308,9 +308,9 @@
 助詞-係助詞
 助詞-係助詞
 #
 #
 #  particle-adverbial:
 #  particle-adverbial:
-#  e.g. がてら, かも, くらい, 位, ぐらい, しも, (学校) じゃ(これが流行っている)-口語/, 
+#  e.g. がてら, かも, くらい, 位, ぐらい, しも, (学校) じゃ(これが流行っている)-口語/,
 #       (それ)じゃあ (よくない)-口語/, ずつ, (私) なぞ, など, (私) なり (に), (先生) なんか (大嫌い)-口語/,
 #       (それ)じゃあ (よくない)-口語/, ずつ, (私) なぞ, など, (私) なり (に), (先生) なんか (大嫌い)-口語/,
-#       (私) なんぞ, (先生) なんて (大嫌い)-口語/, のみ, だけ, (私) だって-口語/, だに, 
+#       (私) なんぞ, (先生) なんて (大嫌い)-口語/, のみ, だけ, (私) だって-口語/, だに,
 #       (彼)ったら-口語/, (お茶) でも (いかが), 等 (とう), (今後) とも, ばかり, ばっか-口語/, ばっかり-口語/,
 #       (彼)ったら-口語/, (お茶) でも (いかが), 等 (とう), (今後) とも, ばかり, ばっか-口語/, ばっかり-口語/,
 #       ほど, 程, まで, 迄, (誰) も (が)([助詞-格助詞] および [助詞-係助詞] の前に位置する「も」)
 #       ほど, 程, まで, 迄, (誰) も (が)([助詞-格助詞] および [助詞-係助詞] の前に位置する「も」)
 助詞-副助詞
 助詞-副助詞
@@ -324,11 +324,11 @@
 助詞-並立助詞
 助詞-並立助詞
 #
 #
 #  particle-final:
 #  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:
 #  adverbial, conjunctive, or sentence final. For example:
 #       (a) 「A か B か」. Ex:「(国内で運用する) か,(海外で運用する) か (.)」
 #       (a) 「A か B か」. Ex:「(国内で運用する) か,(海外で運用する) か (.)」
 #       (b) Inside an adverb phrase. Ex:「(幸いという) か (, 死者はいなかった.)」
 #       (b) Inside an adverb phrase. Ex:「(幸いという) か (, 死者はいなかった.)」
@@ -337,16 +337,16 @@
 #  e.g. か
 #  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.
 #  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.
 #  that are giongo, giseigo, or gitaigo.
 #  e.g. に, と
 #  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.
 #  This includes particles that are used in Tanka, Haiku, and other poetry.
 #  e.g. かな, けむ, ( しただろう) に, (あんた) にゃ(わからん), (俺) ん (家)
 #  e.g. かな, けむ, ( しただろう) に, (あんた) にゃ(わからん), (俺) ん (家)
 助詞-特殊
 助詞-特殊
@@ -357,7 +357,7 @@
 #
 #
 #####
 #####
 #  interjection: Greetings and other exclamations.
 #  interjection: Greetings and other exclamations.
-#  e.g. おはよう, おはようございます, こんにちは, こんばんは, ありがとう, どうもありがとう, ありがとうございます, 
+#  e.g. おはよう, おはようございます, こんにちは, こんばんは, ありがとう, どうもありがとう, ありがとうございます,
 #       いただきます, ごちそうさま, さよなら, さようなら, はい, いいえ, ごめん, ごめんなさい
 #       いただきます, ごちそうさま, さよなら, さようなら, はい, いいえ, ごめん, ごめんなさい
 #感動詞
 #感動詞
 #
 #
@@ -395,7 +395,7 @@
 #  other: unclassified other
 #  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.
 #  sentence-final particles.
 #  e.g. (だ)ァ
 #  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.
 # See http://members.unine.ch/jacques.savoy/clef/index.html.
 # Also see http://www.opensource.org/licenses/bsd-license.html
 # Also see http://www.opensource.org/licenses/bsd-license.html
 # Cleaned on October 11, 2009 (not normalized, so use before normalization)
 # 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 ا
 # 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
 he
 hem
 hem
 heu
 heu
-hi 
+hi
 ho
 ho
 i
 i
 igual
 igual
@@ -142,7 +142,7 @@ pels
 per
 per
 però
 però
 perquè
 perquè
-poc 
+poc
 poca
 poca
 pocs
 pocs
 poques
 poques
@@ -151,7 +151,7 @@ propi
 qual
 qual
 quals
 quals
 quan
 quan
-quant 
+quant
 que
 que
 què
 què
 quelcom
 quelcom
@@ -166,7 +166,7 @@ sa
 semblant
 semblant
 semblants
 semblants
 ses
 ses
-seu 
+seu
 seus
 seus
 seva
 seva
 seva
 seva
@@ -177,9 +177,9 @@ sobretot
 sóc
 sóc
 solament
 solament
 sols
 sols
-son 
+son
 són
 són
-sons 
+sons
 sota
 sota
 sou
 sou
 t'ha
 t'ha

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

@@ -1,6 +1,6 @@
 # Lucene Greek Stopwords list
 # Lucene Greek Stopwords list
 # Note: by default this file is used after GreekLowerCaseFilter,
 # 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
  | Also see http://www.opensource.org/licenses/bsd-license.html
  |  - Encoding was converted to UTF-8.
  |  - Encoding was converted to UTF-8.
  |  - This notice was added.
  |  - This notice was added.
- 
+
 | forms of BE
 | forms of BE
 
 
 olla
 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
 # Also see http://www.opensource.org/licenses/bsd-license.html
 # See http://members.unine.ch/jacques.savoy/clef/index.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.
 # 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,
 # 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
  | Also see http://www.opensource.org/licenses/bsd-license.html
  |  - Encoding was converted to UTF-8.
  |  - Encoding was converted to UTF-8.
  |  - This notice was added.
  |  - This notice was added.
- 
+
 | Hungarian stop word list
 | Hungarian stop word list
 | prepared by Anna Tordai
 | 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
 # 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
 #   pronouns, adverbs, interjections were removed
-# 
+#
 # prepositions
 # prepositions
 aiz
 aiz
 ap
 ap
@@ -101,8 +101,8 @@ tak
 iekams
 iekams
 vien
 vien
 # modal verbs
 # modal verbs
-būt  
-biju 
+būt
+biju
 biji
 biji
 bija
 bija
 bijām
 bijām
@@ -110,8 +110,8 @@ bijāt
 esmu
 esmu
 esi
 esi
 esam
 esam
-esat 
-būšu     
+esat
+būšu
 būsi
 būsi
 būs
 būs
 būsim
 būsim

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

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

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

@@ -27,7 +27,7 @@
  </fields>
  </fields>
 
 
  <uniqueKey><!-- REPLACE UNIQUE KEY --></uniqueKey>
  <uniqueKey><!-- REPLACE UNIQUE KEY --></uniqueKey>
- 
+
   <types>
   <types>
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
 
 
@@ -178,7 +178,7 @@
         />
         />
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
     <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
       <analyzer>
       <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
@@ -231,7 +231,7 @@
 
 
     <!-- Arabic -->
     <!-- Arabic -->
     <fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- for any non-arabic -->
         <!-- for any non-arabic -->
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
@@ -244,26 +244,26 @@
 
 
     <!-- Bulgarian -->
     <!-- Bulgarian -->
     <fieldType name="text_bg" class="solr.TextField" positionIncrementGap="100">
     <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.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>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Catalan -->
     <!-- Catalan -->
     <fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
-        <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>       
+        <filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
     <!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
     <fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
       <analyzer>
@@ -278,27 +278,27 @@
 
 
     <!-- Czech -->
     <!-- Czech -->
     <fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
-        <filter class="solr.CzechStemFilterFactory"/>       
+        <filter class="solr.CzechStemFilterFactory"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Danish -->
     <!-- Danish -->
     <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />
         <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>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- German -->
     <!-- German -->
     <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
         <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"/> -->
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Greek -->
     <!-- Greek -->
     <fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- greek specific lowercase for sigma -->
         <!-- greek specific lowercase for sigma -->
         <filter class="solr.GreekLowerCaseFilterFactory"/>
         <filter class="solr.GreekLowerCaseFilterFactory"/>
@@ -319,10 +319,10 @@
         <filter class="solr.GreekStemFilterFactory"/>
         <filter class="solr.GreekStemFilterFactory"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Spanish -->
     <!-- Spanish -->
     <fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" />
         <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"/> -->
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Basque -->
     <!-- Basque -->
     <fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Persian -->
     <!-- Persian -->
     <fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
       <analyzer>
@@ -353,10 +353,10 @@
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Finnish -->
     <!-- Finnish -->
     <fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
@@ -364,10 +364,10 @@
         <!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
         <!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- French -->
     <!-- French -->
     <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
@@ -378,10 +378,10 @@
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
         <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Irish -->
     <!-- Irish -->
     <fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes d', etc -->
         <!-- removes d', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
@@ -392,10 +392,10 @@
         <filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Galician -->
     <!-- Galician -->
     <fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
@@ -403,10 +403,10 @@
         <!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
         <!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Hindi -->
     <!-- Hindi -->
     <fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <!-- normalizes unicode representation -->
         <!-- normalizes unicode representation -->
@@ -417,30 +417,30 @@
         <filter class="solr.HindiStemFilterFactory"/>
         <filter class="solr.HindiStemFilterFactory"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Hungarian -->
     <!-- Hungarian -->
     <fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
         <filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Armenian -->
     <!-- Armenian -->
     <fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Indonesian -->
     <!-- Indonesian -->
     <fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
@@ -448,10 +448,10 @@
         <filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
         <filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Italian -->
     <!-- Italian -->
     <fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <!-- removes l', etc -->
         <!-- removes l', etc -->
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
         <filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
@@ -480,20 +480,20 @@
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Latvian -->
     <!-- Latvian -->
     <fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
         <filter class="solr.LatvianStemFilterFactory"/>
         <filter class="solr.LatvianStemFilterFactory"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Dutch -->
     <!-- Dutch -->
     <fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
@@ -501,10 +501,10 @@
         <filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Norwegian -->
     <!-- Norwegian -->
     <fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
         <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 -->
         <!-- The "light" and "minimal" stemmers support variants: nb=Bokmål, nn=Nynorsk, no=Both -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Portuguese -->
     <!-- Portuguese -->
     <fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
@@ -527,20 +527,20 @@
         <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
         <!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Romanian -->
     <!-- Romanian -->
     <fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
         <filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
         <filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Russian -->
     <!-- Russian -->
     <fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
@@ -548,10 +548,10 @@
         <!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
         <!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Swedish -->
     <!-- Swedish -->
     <fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
@@ -559,20 +559,20 @@
         <!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
         <!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Thai -->
     <!-- Thai -->
     <fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
         <filter class="solr.ThaiWordFilterFactory"/>
         <filter class="solr.ThaiWordFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
       </analyzer>
       </analyzer>
     </fieldType>
     </fieldType>
-    
+
     <!-- Turkish -->
     <!-- Turkish -->
     <fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
     <fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
-      <analyzer> 
+      <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.TurkishLowerCaseFilterFactory"/>
         <filter class="solr.TurkishLowerCaseFilterFactory"/>
         <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" />
         <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(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
 #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(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(lens)#lensNoQ#q#end
-        
+
 
 
 #macro(url_for_lens)#{url_for_home}#lens#end
 #macro(url_for_lens)#{url_for_home}#lens#end
 
 
@@ -91,7 +91,7 @@
       #end
       #end
     #end
     #end
     </ul>
     </ul>
-  #end      
+  #end
 #end
 #end
 
 
 
 
@@ -150,7 +150,7 @@ $pad$v##
 $v##
 $v##
     #end
     #end
   #end
   #end
-#end  
+#end
 
 
 #macro(utc_date $theDate)
 #macro(utc_date $theDate)
 $date.format("yyyy-MM-dd'T'HH:mm:ss'Z'",$theDate,$date.getLocale(),$date.getTimeZone().getTimeZone("UTC"))##
 $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;
 	padding: 2px 5px;
 	cursor: default;
 	cursor: default;
 	display: block;
 	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
 	when scroll mode will be used
 	*/
 	*/
 	/*width: 100%;*/
 	/*width: 100%;*/
 	font: menu;
 	font: menu;
 	font-size: 12px;
 	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
 	in relative units scroll will be broken in firefox
 	*/
 	*/
 	line-height: 16px;
 	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)
 		if (!options.matchCase)
 			term = term.toLowerCase();
 			term = term.toLowerCase();
 		var data = cache.load(term);
 		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
 		// recieve the cached data
 		if (data && data.length) {
 		if (data && data.length) {
 			success(term, data);
 			success(term, data);
@@ -419,7 +419,7 @@ $.Autocompleter.Cache = function(options) {
 	var length = 0;
 	var length = 0;
 	
 	
 	function matchSubset(s, sub) {
 	function matchSubset(s, sub) {
-		if (!options.matchCase) 
+		if (!options.matchCase)
 			s = s.toLowerCase();
 			s = s.toLowerCase();
 		var i = s.indexOf(sub);
 		var i = s.indexOf(sub);
 		if (options.matchContains == "word"){
 		if (options.matchContains == "word"){
@@ -433,7 +433,7 @@ $.Autocompleter.Cache = function(options) {
 		if (length > options.cacheLength){
 		if (length > options.cacheLength){
 			flush();
 			flush();
 		}
 		}
-		if (!data[q]){ 
+		if (!data[q]){
 			length++;
 			length++;
 		}
 		}
 		data[q] = value;
 		data[q] = value;
@@ -463,7 +463,7 @@ $.Autocompleter.Cache = function(options) {
 				
 				
 			var firstChar = value.charAt(0).toLowerCase();
 			var firstChar = value.charAt(0).toLowerCase();
 			// if no lookup array for this character exists, look it up now
 			// if no lookup array for this character exists, look it up now
-			if( !stMatchSets[firstChar] ) 
+			if( !stMatchSets[firstChar] )
 				stMatchSets[firstChar] = [];
 				stMatchSets[firstChar] = [];
 
 
 			// if the match is a string
 			// if the match is a string
@@ -506,7 +506,7 @@ $.Autocompleter.Cache = function(options) {
 		load: function(q) {
 		load: function(q) {
 			if (!options.cacheLength || !length)
 			if (!options.cacheLength || !length)
 				return null;
 				return null;
-			/* 
+			/*
 			 * if dealing w/local data and matchContains than we must make sure
 			 * if dealing w/local data and matchContains than we must make sure
 			 * to loop through all the data collections looking for matches
 			 * to loop through all the data collections looking for matches
 			 */
 			 */
@@ -528,7 +528,7 @@ $.Autocompleter.Cache = function(options) {
 					}
 					}
 				}				
 				}				
 				return csub;
 				return csub;
-			} else 
+			} else
 			// if the exact item exists, use it
 			// if the exact item exists, use it
 			if (data[q]){
 			if (data[q]){
 				return data[q];
 				return data[q];
@@ -578,7 +578,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		list = $("<ul/>").appendTo(element).mouseover( function(event) {
 		list = $("<ul/>").appendTo(element).mouseover( function(event) {
 			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
 			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
 	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
 	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-			    $(target(event)).addClass(CLASSES.ACTIVE);            
+			    $(target(event)).addClass(CLASSES.ACTIVE);
 	        }
 	        }
 		}).click(function(event) {
 		}).click(function(event) {
 			$(target(event)).addClass(CLASSES.ACTIVE);
 			$(target(event)).addClass(CLASSES.ACTIVE);
@@ -596,7 +596,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 			element.css("width", options.width);
 			element.css("width", options.width);
 			
 			
 		needsInit = false;
 		needsInit = false;
-	} 
+	}
 	
 	
 	function target(event) {
 	function target(event) {
 		var element = event.target;
 		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")) );
 						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
 					}
 					}
                 }
                 }
-                
+
             }
             }
 		},
 		},
 		selected: function() {
 		selected: function() {

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

@@ -1,6 +1,6 @@
 #admin{
 #admin{
   text-align: right;
   text-align: right;
-  vertical-align: top; 
+  vertical-align: top;
 }
 }
 
 
 #head{
 #head{
@@ -46,7 +46,7 @@ a {
   width: 185px;
   width: 185px;
   padding: 5px;
   padding: 5px;
   top: -20px;
   top: -20px;
-  position: relative;  
+  position: relative;
 }
 }
 
 
 .tabs-bar {
 .tabs-bar {
@@ -142,11 +142,11 @@ a {
 }
 }
 
 
 .query-box {
 .query-box {
-  
+
 }
 }
 
 
 .query-boost {
 .query-boost {
-  
+
   top: 10px;
   top: 10px;
   left: 50px;
   left: 50px;
   position: relative;
   position: relative;
@@ -156,7 +156,7 @@ a {
 .query-box .inputs{
 .query-box .inputs{
   left: 180px;
   left: 180px;
   position: relative;
   position: relative;
-  
+
 }
 }
 
 
 #logo {
 #logo {
@@ -194,13 +194,13 @@ a {
 }
 }
 
 
 .mlt{
 .mlt{
-  
+
 }
 }
 
 
 .map{
 .map{
   float: right;
   float: right;
   position: relative;
   position: relative;
-  top: -25px;  
+  top: -25px;
 }
 }
 
 
 .result-document:nth-child(2n+1) {
 .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>
         </option>
 
 
       </select>
       </select>
-    </label>  
+    </label>
 
 
     <input type="hidden" name="group" value="true"/>
     <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" name="sfield" value="store"/>
     <input type="hidden" id="spatialFQ" name="fq" value=""/>
     <input type="hidden" id="spatialFQ" name="fq" value=""/>
-    <input type="hidden" name="queryOpts" value="spatial"/>        
+    <input type="hidden" name="queryOpts" value="spatial"/>
 
 
   </div>
   </div>
 
 

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

@@ -77,7 +77,7 @@
 ## Resource Name
 ## Resource Name
 <div>
 <div>
   #if($doc.getFieldValue('resourcename'))
   #if($doc.getFieldValue('resourcename'))
-    Resource name: $filename 
+    Resource name: $filename
   #elseif($url)
   #elseif($url)
     URL: $url
     URL: $url
   #end
   #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'?>
 <?xml version='1.0' encoding='UTF-8'?>
 
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * this work for additional information regarding copyright ownership.
@@ -17,17 +17,17 @@
  * limitations under the License.
  * limitations under the License.
  -->
  -->
 
 
-<!-- 
+<!--
   Simple transform of Solr query results to HTML
   Simple transform of Solr query results to HTML
  -->
  -->
 <xsl:stylesheet version='1.0'
 <xsl:stylesheet version='1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
     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:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
-  
+
   <xsl:template match='/'>
   <xsl:template match='/'>
     <html>
     <html>
       <head>
       <head>
@@ -44,7 +44,7 @@
       </body>
       </body>
     </html>
     </html>
   </xsl:template>
   </xsl:template>
-  
+
   <xsl:template match="doc">
   <xsl:template match="doc">
     <xsl:variable name="pos" select="position()"/>
     <xsl:variable name="pos" select="position()"/>
     <div class="doc">
     <div class="doc">
@@ -110,7 +110,7 @@
   </xsl:template>
   </xsl:template>
 
 
   <xsl:template match="*"/>
   <xsl:template match="*"/>
-  
+
   <xsl:template name="css">
   <xsl:template name="css">
     <script>
     <script>
       function toggle(id) {
       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'?>
 <?xml version='1.0' encoding='UTF-8'?>
 
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * this work for additional information regarding copyright ownership.
@@ -17,7 +17,7 @@
  * limitations under the License.
  * limitations under the License.
  -->
  -->
 
 
-<!-- 
+<!--
   Simple transform of Solr query results to Atom
   Simple transform of Solr query results to Atom
  -->
  -->
 
 
@@ -42,7 +42,7 @@
         <name>Apache Solr</name>
         <name>Apache Solr</name>
         <email>solr-user@lucene.apache.org</email>
         <email>solr-user@lucene.apache.org</email>
       </author>
       </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"/>
             href="http://localhost:8983/solr/q={$query}&amp;wt=xslt&amp;tr=atom.xsl"/>
       <updated>
       <updated>
         <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
         <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
@@ -51,7 +51,7 @@
       <xsl:apply-templates select="response/result/doc"/>
       <xsl:apply-templates select="response/result/doc"/>
     </feed>
     </feed>
   </xsl:template>
   </xsl:template>
-    
+
   <!-- search results xslt -->
   <!-- search results xslt -->
   <xsl:template match="doc">
   <xsl:template match="doc">
     <xsl:variable name="id" select="str[@name='id']"/>
     <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'?>
 <?xml version='1.0' encoding='UTF-8'?>
 
 
-<!-- 
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * this work for additional information regarding copyright ownership.
@@ -17,7 +17,7 @@
  * limitations under the License.
  * limitations under the License.
  -->
  -->
 
 
-<!-- 
+<!--
   Simple transform of Solr query results to RSS
   Simple transform of Solr query results to RSS
  -->
  -->
 
 
@@ -44,7 +44,7 @@
        </channel>
        </channel>
     </rss>
     </rss>
   </xsl:template>
   </xsl:template>
-  
+
   <!-- search results xslt -->
   <!-- search results xslt -->
   <xsl:template match="doc">
   <xsl:template match="doc">
     <xsl:variable name="id" select="str[@name='id']"/>
     <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 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 not use this file except in compliance with
     the License.  You may obtain a copy of the License at
     the License.  You may obtain a copy of the License at
-    
+
     http://www.apache.org/licenses/LICENSE-2.0
     http://www.apache.org/licenses/LICENSE-2.0
-    
+
     Unless required by applicable law or agreed to in writing, software
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
 -->
 -->
 
 
 
 
-<!-- 
+<!--
   Display the luke request handler with graphs
   Display the luke request handler with graphs
  -->
  -->
 <xsl:stylesheet
 <xsl:stylesheet
@@ -190,7 +190,7 @@
                  <div class="histogram">
                  <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>
                   <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>
                  </div>
-                   </td> 
+                   </td>
                 </xsl:for-each>
                 </xsl:for-each>
               </tr>
               </tr>
               <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
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * this work for additional information regarding copyright ownership.
@@ -30,7 +30,7 @@
         <xsl:apply-templates select="response/result/doc"/>
         <xsl:apply-templates select="response/result/doc"/>
     </add>
     </add>
   </xsl:template>
   </xsl:template>
-  
+
   <!-- Ignore score (makes no sense to index) -->
   <!-- Ignore score (makes no sense to index) -->
   <xsl:template match="doc/*[@name='score']" priority="100">
   <xsl:template match="doc/*[@name='score']" priority="100">
   </xsl:template>
   </xsl:template>
@@ -47,7 +47,7 @@
   <!-- Flatten arrays to duplicate field lines -->
   <!-- Flatten arrays to duplicate field lines -->
   <xsl:template match="doc/arr" priority="100">
   <xsl:template match="doc/arr" priority="100">
       <xsl:variable name="fn" select="@name"/>
       <xsl:variable name="fn" select="@name"/>
-      
+
       <xsl:for-each select="*">
       <xsl:for-each select="*">
 		<xsl:element name="field">
 		<xsl:element name="field">
 		    <xsl:attribute name="name"><xsl:value-of select="$fn"/></xsl:attribute>
 		    <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>
 </style>
 
 
 
 
-<div class="search-bar" style="height: 30px">  
+<div class="search-bar" style="height: 30px">
   <div class="pull-right" style="margin-right: 20px">
   <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}">
     <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') }
       <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()">
           <div data-bind="visible: collections().length > 0 && !isLoading()">
             <input type="text" data-bind="filter: { 'list': collections, 'filteredList': filteredCollections, 'test': filterTest }"
             <input type="text" data-bind="filter: { 'list': collections, 'filteredList': filteredCollections, 'test': filterTest }"
                 placeholder="${_('Filter collections...')}" class="input-xlarge search-query">
                 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">
                 title="${_('Delete the selected collections')}" data-toggle="modal" data-target="#deleteCollections">
               <i class="fa fa-times"></i> ${_('Delete')}
               <i class="fa fa-times"></i> ${_('Delete')}
             </button>
             </button>
@@ -338,7 +338,7 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
     <ul class="nav nav-list">
     <ul class="nav nav-list">
       <li class="nav-header">${_('Actions')}</li>
       <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="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>
       <li><a href="#deleteCollection" data-toggle="modal"><i class="fa fa-times"></i> ${_('Delete')}</a></li>
     </ul>
     </ul>
   </div>
   </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>
 <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>
                 <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>
                     <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>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><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>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>
                 </p>
-                
+
 
 
 <h2>Solr Search Installation and Configuration</h2>
 <h2>Solr Search Installation and Configuration</h2>
 
 

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