Преглед на файлове

HUE-7584 [solr] Support default field via the config API

Romain Rigaux преди 8 години
родител
ревизия
73d6292
променени са 2 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 2 2
      desktop/libs/indexer/src/indexer/api3.py
  2. 7 1
      desktop/libs/indexer/src/indexer/solr_client.py

+ 2 - 2
desktop/libs/indexer/src/indexer/api3.py

@@ -242,11 +242,11 @@ def _create_index(user, fs, client, source, destination, index_name):
     client.create_index(
         name=index_name,
         config_name=destination.get('indexerConfigSet'),
-        fields=fields,        
+        fields=fields,
         unique_key_field=unique_key_field,
         df=df,
         shards=destination['indexerNumShards'],
-        replication=destination['indexerReplicationFactor'],
+        replication=destination['indexerReplicationFactor']
     )
 
   if source['inputFormat'] not in ('manual', 'table'):

+ 7 - 1
desktop/libs/indexer/src/indexer/solr_client.py

@@ -107,7 +107,13 @@ class SolrClient(object):
           # Note: uniqueKey is always 'id'
           self.api.create_config(name, config_name, immutable=False)
 
-        # df
+          if df:
+            self.api.update_config(name, {
+              'update-requesthandler': {
+                "name": "/query",
+                "df": df,
+              }
+            })
 
         self.api.create_collection2(name, config_name=config_name, shards=shards, replication=replication)