mirror of
https://github.com/djohnlewis/stackdump
synced 2024-12-04 23:17:37 +00:00
Changed the default operator to AND properly this time. It has been changed in Solr configuration, instead of hacking the query string.
This commit is contained in:
parent
888d7d2e94
commit
6c58938d44
@ -585,7 +585,7 @@
|
||||
<defaultSearchField>text</defaultSearchField>
|
||||
|
||||
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
|
||||
<solrQueryParser defaultOperator="OR"/>
|
||||
<solrQueryParser defaultOperator="AND"/>
|
||||
|
||||
<!-- copyField commands copy one field to another at the time a document
|
||||
is added to the index. It's used either to index the same field differently,
|
||||
|
@ -269,7 +269,7 @@ def view_question(site_key, question_id):
|
||||
raise HTTPError(code=404, output='No site exists with the key %s.' % site_key)
|
||||
|
||||
# get the question referenced by this question id
|
||||
query = 'id:%s AND siteKey:%s' % (question_id, site_key)
|
||||
query = 'id:%s siteKey:%s' % (question_id, site_key)
|
||||
results = solr_conn().search(query)
|
||||
if len(results) == 0:
|
||||
raise HTTPError(code=404, output='No question exists with the id %s.' % question_id)
|
||||
@ -490,10 +490,8 @@ def perform_search(site_key=None):
|
||||
# this query string contains any special bits we add that we don't want
|
||||
# the user to see.
|
||||
int_query = query
|
||||
# force keywords to default to being ANDed, instead of ORed.
|
||||
int_query = '{!lucene q.op=AND}' + query
|
||||
if site_key:
|
||||
int_query += ' AND siteKey:%s' % site_key
|
||||
int_query += ' siteKey:%s' % site_key
|
||||
|
||||
# the page GET parameter is zero-based
|
||||
page = int(request.GET.get('p', 0))
|
||||
|
Loading…
Reference in New Issue
Block a user