Browse Source

HUE-7409 [search] The collection scheam config was being ignored

Romain Rigaux 8 years ago
parent
commit
9824796141

+ 1 - 0
desktop/libs/indexer/src/indexer/indexers/morphline.py

@@ -136,6 +136,7 @@ class MorphlineIndexer(object):
 
     while len(queue):
       curr_field = queue.popleft()
+      curr_field['type'] = curr_field['type'].replace('long', 'plong').replace('double', 'pdouble').replace('date', 'pdate')
       fields.append(curr_field)
 
       for operation in curr_field["operations"]:

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

@@ -99,9 +99,6 @@ class Command(BaseCommand):
           df=collection['df']
       )
 
-      if self.client.is_solr_six_or_more():
-        self.client.update_config(collection['name'], {'set-user-property': {'update.autoCreateFields': 'false'}})
-
       with open(path) as fh:
         self.client.index(collection['name'], fh.read())
 

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

@@ -94,6 +94,7 @@ class SolrClient(object):
     if self.is_solr_cloud_mode():
       if config_name is None:
         self._create_cloud_config(name, fields, unique_key_field, df)
+        config_name = name
 
       self.api.create_collection2(name, config_name=config_name, shards=shards, replication=replication)
       fields = [{
@@ -103,7 +104,6 @@ class SolrClient(object):
         } for field in fields
       ]
       if self.is_solr_six_or_more():
-        self.api.update_config(name, {'set-user-property': {'update.autoCreateFields': 'false'}})
         self.api.add_fields(name, fields)
     else:
       self._create_non_solr_cloud_index(name, fields, unique_key_field, df)