You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2026/02/13 17:42:26 UTC

(allura) 02/02: remove solr.use_new_types setting and always do the new mode

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/old_solr_cleanup
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 4c2346d529c9932cd8f9790784cecff0144d4765
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Feb 13 12:03:51 2026 -0500

    remove solr.use_new_types setting and always do the new mode
---
 Allura/development.ini                    |  5 -----
 ForgeTracker/forgetracker/model/ticket.py | 18 ++----------------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/Allura/development.ini b/Allura/development.ini
index 3774d6a23..8c594e8e8 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -601,11 +601,6 @@ solr.short_timeout = 10
 solr.commit = false
 ; commit add operations within N ms
 solr.commitWithin = 10000
-; Use improved data types for labels and custom fields?
-; New Allura deployments should leave this set to true. Existing deployments
-; should set to false until existing data has been reindexed. Reindexing will
-; convert existing label and custom field data to more appropriate solr types.
-solr.use_new_types = true
 
 ; Incoming email settings.  Used when you run: paster smtp_server development.ini
 ; address to listen to
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index bbec87215..b98784bb7 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -95,7 +95,7 @@ def get_default_for_solr_type(solr_type):
 
 config = utils.ConfigProxy(
     common_suffix='forgemail.domain',
-    new_solr='solr.use_new_types')
+)
 
 
 class Globals(MappedClass):
@@ -265,10 +265,6 @@ def invalidate_bin_counts(self):
 
     def sortable_custom_fields_shown_in_search(self):
         def solr_type(field_name):
-            # Pre solr-4.2.1 code indexed all custom fields as strings, so
-            # they must be searched as such.
-            if not config.get_bool('new_solr'):
-                return '_s'
             return self.get_custom_field_solr_type(field_name) or '_s'
 
         return [dict(
@@ -729,12 +725,6 @@ def index(self):
             import_id_s=ImportIdConverter.get().simplify(self.import_id)
         )
         for k, v in self.custom_fields.items():
-            # Pre solr-4.2.1 code expects all custom fields to be indexed
-            # as strings.
-            if not config.get_bool('new_solr'):
-                result[k + '_s'] = str(v)
-
-            # Now let's also index with proper Solr types.
             solr_type = self.app.globals.get_custom_field_solr_type(k)
             if solr_type:
                 result[k + solr_type] = (v or
@@ -770,11 +760,7 @@ def translate_query(cls, q, fields):
         solr_field = '{0}{1}'
         solr_type = '_s'
         for f in cf:
-            # Solr 4.2.1 index contains properly typed custom fields, so we
-            # can search on those instead of the old string-type solr fields.
-            if config.get_bool('new_solr'):
-                solr_type = (c.app.globals.get_custom_field_solr_type(f)
-                             or solr_type)
+            solr_type = c.app.globals.get_custom_field_solr_type(f) or solr_type
             actual = solr_field.format(f, solr_type)
             q = q.replace(f + ':', actual + ':')
         return q