allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: Use correct capitalization for solr "OR"
Date Fri, 07 Sep 2018 16:23:49 GMT
Repository: allura
Updated Branches:
  refs/heads/master ca1970277 -> 4b03e3cd6


Use correct capitalization for solr "OR"


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4b3b30ad
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4b3b30ad
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4b3b30ad

Branch: refs/heads/master
Commit: 4b3b30ada6199ede52e009d44115fd7a0f5207cc
Parents: ca19702
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Sep 7 12:19:09 2018 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Sep 7 12:19:09 2018 -0400

----------------------------------------------------------------------
 Allura/allura/ext/personal_dashboard/dashboard_main.py |  2 +-
 Allura/allura/lib/solr.py                              | 10 +++++++++-
 ForgeTracker/forgetracker/model/ticket.py              |  2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4b3b30ad/Allura/allura/ext/personal_dashboard/dashboard_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/personal_dashboard/dashboard_main.py b/Allura/allura/ext/personal_dashboard/dashboard_main.py
index 4f2a9f9..fc48c7c 100644
--- a/Allura/allura/ext/personal_dashboard/dashboard_main.py
+++ b/Allura/allura/ext/personal_dashboard/dashboard_main.py
@@ -70,7 +70,7 @@ class TicketsSection(DashboardSectionBase):
     def query_tickets(self, page, limit):
         from forgetracker.model import Ticket
 
-        q = ' or '.join(['assigned_to:' + str(self.user['username']), 'reported_by:' + str(self.user['username'])])
+        q = ' OR '.join(['assigned_to:' + str(self.user['username']), 'reported_by:' + str(self.user['username'])])
         sort = 'mod_date_dt desc'
         result = Ticket.paged_search(None, self.user, q, limit=limit, page=page, sort=sort)
 

http://git-wip-us.apache.org/repos/asf/allura/blob/4b3b30ad/Allura/allura/lib/solr.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/solr.py b/Allura/allura/lib/solr.py
index e7ed325..b74a4ab 100644
--- a/Allura/allura/lib/solr.py
+++ b/Allura/allura/lib/solr.py
@@ -16,11 +16,16 @@
 #       under the License.
 
 import shlex
+import logging
 
 from tg import config
 from paste.deploy.converters import asbool
 import pysolr
 
+
+log = logging.getLogger(__name__)
+
+
 escape_rules = {'+': r'\+',
                 '-': r'\-',
                 '&': r'\&',
@@ -153,7 +158,10 @@ class MockSOLR(object):
         if fq:
             q_parts += fq
         for part in q_parts:
-            if part == '&&':
+            if part in ('&&', 'AND'):
+                continue
+            if part in ('||', 'OR'):
+                log.warn("MockSOLR doesn't implement OR yet; treating as AND")
                 continue
             if ':' in part:
                 field, value = part.split(':', 1)

http://git-wip-us.apache.org/repos/asf/allura/blob/4b3b30ad/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 29687d9..aab5481 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -161,7 +161,7 @@ class Globals(MappedClass):
 
     @property
     def closed_query(self):
-        return ' or '.join(['status:' + name for name in self.set_of_closed_status_names])
+        return ' OR '.join(['status:' + name for name in self.set_of_closed_status_names])
 
     @property
     def milestone_fields(self):


Mime
View raw message