Append * on simple query like "somephrase23" or "attribute: somephrase23"
This commit is contained in:
parent
81c6aa0af0
commit
e81d871b01
1 changed files with 6 additions and 3 deletions
|
@ -198,9 +198,12 @@ return search result
|
|||
data['query']['bool']['must'] = []
|
||||
end
|
||||
|
||||
# add * on simple query search
|
||||
if query && query =~ /^[[:alpha:]]+$/
|
||||
query += '*'
|
||||
# add * on simple query like "somephrase23" or "attribute: somephrase23"
|
||||
if query.present?
|
||||
query.strip!
|
||||
if query =~ /^([[:alpha:],0-9]+|[[:alpha:]]+\:\s+[[:alpha:],0-9]+)$/
|
||||
query += '*'
|
||||
end
|
||||
end
|
||||
|
||||
# real search condition
|
||||
|
|
Loading…
Reference in a new issue