Pārlūkot izejas kodu

[search] Add correct start date in twitter example

Romain Rigaux 11 gadi atpakaļ
vecāks
revīzija
1e8ea71

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
apps/search/src/search/fixtures/initial_search_examples.json


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

@@ -318,6 +318,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
         <br/>
       <!-- /ko -->
     <!-- /ko -->
+
     <!-- ko if: type() == 'field' -->
       <div class="facet-field-cnt">
         <span class="spinedit-cnt">
@@ -326,10 +327,10 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       </div>
     <!-- /ko -->
 
-    <a href="javascript: void(0)" class="btn btn-loading" data-bind="visible: properties.canRange, click: $root.collection.toggleRangeFacet" data-loading-text="...">
+    <a href="javascript: void(0)" title="${ _('Toggle range or field facet') }" class="btn btn-loading" data-bind="visible: properties.canRange, click: $root.collection.toggleRangeFacet" data-loading-text="...">
       <i class="fa" data-bind="css: { 'fa-arrows-h': type() == 'range', 'fa-circle': type() == 'field' }, attr: { title: type() == 'range' ? 'Range' : 'Term' }"></i>
     </a>
-    <a href="javascript: void(0)" class="btn btn-loading" data-bind="click: $root.collection.toggleSortFacet" data-loading-text="...">
+    <a href="javascript: void(0)" title="${ _('Toggle sort order') }" class="btn btn-loading" data-bind="click: $root.collection.toggleSortFacet" data-loading-text="...">
       <i class="fa" data-bind="css: { 'fa-caret-down': properties.sort() == 'desc', 'fa-caret-up': properties.sort() == 'asc' }"></i>
     </a>
 </script>
@@ -708,7 +709,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       </span>
     </div>
 
-    <div style="padding-bottom: 10px; text-align: center">
+    <div style="padding-bottom: 10px; text-align: left">
       <a href="javascript:void(0)" data-bind="click: $root.collection.timeLineZoom"><i class="fa fa-search-minus"></i></a>
       <span class="facet-field-label">${ _('Group by') }</span>
       <select class="input-medium" data-bind="options: $root.query.multiqs, optionsValue: 'id',optionsText: 'label', value: $root.query.selectedMultiq"></select>

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

@@ -157,9 +157,9 @@ class TestWithMockedSolr(TestSearchBase):
     })
     csv_response_content = csv_response.content
     assert_equal('application/csv', csv_response['Content-Type'])
-    assert_equal(7434, len(csv_response_content))
-    assert_true('article_title,journal_issn,author,language,journal_title,journal_country,article_pagination,ontologies,affiliation,date_created,article_date,journal_iso_abbreviation,journal_publication_date,_version_,article_abstract_text,id' in csv_response_content, csv_response_content)
-    assert_true("""Interference of bacterial cell-to-cell communication: a new concept of antimicrobial chemotherapy breaks antibiotic resistance.,1664-302X,"[u&#39;Hidetada H Hirakawa&#39;, u&#39;Haruyoshi H Tomita&#39;]",eng,Frontiers in microbiology,Switzerland,114,"[u&#39;2402|1 &#39;, u&#39;1875|1 &#39;""" in csv_response_content, csv_response_content)
+    assert_equal(7490, len(csv_response_content))
+    assert_true('article_title,showDetails,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,details' in csv_response_content, csv_response_content)
+    assert_true("""Investigations for neonatal seizures.,False,1878-0946,"[u&#39;B B Hallberg&#39;, u&#39;M M Blennow&#39;]",""" in csv_response_content, csv_response_content)
 
     xls_response = self.c.post(reverse('search:download'), {
         'xls': True,

+ 4 - 4
desktop/libs/indexer/src/indexer/management/commands/indexer_setup.py

@@ -92,11 +92,11 @@ class Command(NoArgsCommand):
 
       # Put in HDFS
       with open(path) as fh:
-        if self.fs.do_as_user(self.fs.DEFAULT_USER, self.fs.exists, hdfs_path):
+        if self.fs.do_as_user(self.user.username, self.fs.exists, hdfs_path):
           overwrite = True
         else:
           overwrite = False
-        self.fs.do_as_user(self.fs.DEFAULT_USER, self.fs.create, hdfs_path, data=fh.read(), overwrite=overwrite)
+        self.fs.do_as_user(self.user.username, self.fs.create, hdfs_path, data=fh.read(), overwrite=overwrite)
 
       # Index data
       self.searcher.update_data_from_hdfs(self.fs,
@@ -112,8 +112,8 @@ class Command(NoArgsCommand):
       raise
     finally:
       # Remove HDFS file
-      if self.fs.do_as_user(self.fs.DEFAULT_USER, self.fs.exists, hdfs_path):
-        self.fs.remove(hdfs_path, skip_trash=True)
+      if self.fs.do_as_user(self.user.username, self.fs.exists, hdfs_path):
+        self.fs.do_as_user(self.user.username, self.fs.remove, hdfs_path, skip_trash=True)
 
   def _parse_fields(self, path, separator=',', quote_character='"', fieldtypes={}):
     with open(path) as fh:

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels