Skip to content

Commit

Permalink
Use correct capitalization for solr "OR"
Browse files Browse the repository at this point in the history
  • Loading branch information
brondsem committed Sep 7, 2018
1 parent ca19702 commit 4b3b30a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Allura/allura/ext/personal_dashboard/dashboard_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 9 additions & 1 deletion Allura/allura/lib/solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'\&',
Expand Down Expand Up @@ -153,7 +158,10 @@ def search(self, q, fq=None, **kw):
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)
Expand Down
2 changes: 1 addition & 1 deletion ForgeTracker/forgetracker/model/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def not_closed_mongo_query(self):

@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):
Expand Down

0 comments on commit 4b3b30a

Please sign in to comment.