mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 05:39:22 +02:00
[fix] remove broken ? search operator
The ? search operator has been broken for some time and currently only raises the question why it's still there. ## Context ## The query "Paris !images" searches for "Paris" in the "images" category. Once upon a time Searx supported "Paris ?images" to search for "Paris" in the currently enabled categories and the "images" category. The feature makes sense ... the ? syntax does not. We will hopefully introduce a +!images syntax in the future. Fixes #702.
This commit is contained in:
parent
03189d60f4
commit
61935c72ef
4 changed files with 5 additions and 16 deletions
|
@ -230,13 +230,12 @@ class TestExternalBangParser(SearxTestCase):
|
|||
class TestBang(SearxTestCase):
|
||||
|
||||
SPECIFIC_BANGS = ['!dummy_engine', '!du', '!general']
|
||||
NOT_SPECIFIC_BANGS = ['?dummy_engine', '?du', '?general']
|
||||
THE_QUERY = 'the query'
|
||||
|
||||
def test_bang(self):
|
||||
load_engines(TEST_ENGINES)
|
||||
|
||||
for bang in TestBang.SPECIFIC_BANGS + TestBang.NOT_SPECIFIC_BANGS:
|
||||
for bang in TestBang.SPECIFIC_BANGS:
|
||||
with self.subTest(msg="Check bang", bang=bang):
|
||||
query_text = TestBang.THE_QUERY + ' ' + bang
|
||||
query = RawTextQuery(query_text, [])
|
||||
|
@ -252,13 +251,6 @@ class TestBang(SearxTestCase):
|
|||
query = RawTextQuery(query_text, [])
|
||||
self.assertTrue(query.specific)
|
||||
|
||||
def test_not_specific(self):
|
||||
for bang in TestBang.NOT_SPECIFIC_BANGS:
|
||||
with self.subTest(msg="Check bang is not specific", bang=bang):
|
||||
query_text = TestBang.THE_QUERY + ' ' + bang
|
||||
query = RawTextQuery(query_text, [])
|
||||
self.assertFalse(query.specific)
|
||||
|
||||
def test_bang_not_found(self):
|
||||
load_engines(TEST_ENGINES)
|
||||
query = RawTextQuery('the query !bang_not_found', [])
|
||||
|
@ -278,5 +270,5 @@ class TestBang(SearxTestCase):
|
|||
query = RawTextQuery('the query !', [])
|
||||
self.assertEqual(query.autocomplete_list, ['!images', '!wikipedia', '!osm'])
|
||||
|
||||
query = RawTextQuery('the query ?', ['osm'])
|
||||
self.assertEqual(query.autocomplete_list, ['?images', '?wikipedia'])
|
||||
query = RawTextQuery('the query !', ['osm'])
|
||||
self.assertEqual(query.autocomplete_list, ['!images', '!wikipedia'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue