浏览代码

[indexer] Add jobs example

Abraham Elmahrek 11 年之前
父节点
当前提交
8c85408
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      desktop/libs/indexer/src/indexer/management/commands/indexer_install_examples.py

+ 9 - 0
desktop/libs/indexer/src/indexer/management/commands/indexer_install_examples.py

@@ -58,6 +58,15 @@ class Command(NoArgsCommand):
     }, twitter_path)
     LOG.info(_("Yelp collection successfully installed"))
 
+    LOG.info(_("Installing jobs collection"))
+    twitter_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../../../../apps/search/examples/collections/solr_configs_jobs_demo/index_data.csv'))
+    self._setup_collection_from_csv({
+      'name': 'jobs_example',
+      'fields': self._parse_fields(twitter_path),
+      'uniqueKeyField': 'id'
+    }, twitter_path)
+    LOG.info(_("Jobs collection successfully installed"))
+
   def _setup_collection_from_csv(self, collection, path, separator=',', quote_character='"'):
     if self.searcher.collection_exists(collection['name']):
       self.searcher.delete_collection(collection['name'])