Add * automatically to normal queries.

This commit is contained in:
Martin Edenhofer 2016-03-14 23:29:39 +01:00
parent 9717296f7d
commit 72d22ad56b
4 changed files with 13 additions and 8 deletions

View file

@ -185,6 +185,11 @@ return search result
data['query']['bool']['must'] = []
end
# add * on simple query search
if query && query =~ /^\w+$/
query += '*'
end
# real search condition
condition = {
'query_string' => {

View file

@ -16,7 +16,7 @@ class AgentTicketOverviewLevel0Test < TestCase
# create new ticket
ticket1 = ticket_create(
data: {
customer: 'nico*',
customer: 'nico',
group: 'Users',
title: 'overview count test #1',
body: 'overview count test #1',
@ -24,7 +24,7 @@ class AgentTicketOverviewLevel0Test < TestCase
)
ticket2 = ticket_create(
data: {
customer: 'nico*',
customer: 'nico',
group: 'Users',
title: 'overview count test #2',
body: 'overview count test #2',
@ -178,7 +178,7 @@ class AgentTicketOverviewLevel0Test < TestCase
# create new ticket
ticket3 = ticket_create(
data: {
customer: 'nico*',
customer: 'nico',
group: 'Users',
title: 'overview count test #3',
body: 'overview count test #3',

View file

@ -52,7 +52,7 @@ class AgentTicketOverviewLevel1Test < TestCase
ticket1 = ticket_create(
browser: browser1,
data: {
customer: 'nico*',
customer: 'nico',
priority: '1 low',
group: 'Users',
title: 'overview #1',
@ -69,7 +69,7 @@ class AgentTicketOverviewLevel1Test < TestCase
ticket2 = ticket_create(
browser: browser1,
data: {
customer: 'nico*',
customer: 'nico',
priority: '1 low',
group: 'Users',
title: 'overview #2',
@ -80,7 +80,7 @@ class AgentTicketOverviewLevel1Test < TestCase
ticket3 = ticket_create(
browser: browser1,
data: {
customer: 'nico*',
customer: 'nico',
priority: '1 low',
group: 'Users',
title: 'overview #3',

View file

@ -1219,7 +1219,7 @@ wait untill text in selector disabppears
element.clear
# workaround, sometimes focus is not triggered
element.send_keys(params[:customer] + '*')
element.send_keys(params[:customer])
sleep 3.5
# check if pulldown is open, it's not working stable via selenium
@ -1487,7 +1487,7 @@ wait untill text in selector disabppears
element.clear
# workaround, sometimes focus is not triggered
element.send_keys(data[:customer] + '*')
element.send_keys(data[:customer])
sleep 3.5
# check if pulldown is open, it's not working stable via selenium