Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
58fc8571c2560a8d9f002a09ba9cc383e1d67f9e
1 parent
44dd8a8d
fuzzy key
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
apps/product/models/search.js
apps/product/models/search.js
View file @
58fc857
...
...
@@ -493,12 +493,16 @@ const getSearchKeywordData = (params, uid) => {
}
return
Promise
.
all
([
getFuzzyDatas
(
params
.
query
),
getFuzzyDatas
(
`
$
{
params
.
query
}
`
.
substr
(
0
,
2
)
),
getSearchData
(
initialData
)
]).
then
(
result
=>
{
let
fuzzy
=
[];
_
.
forEach
(
result
[
0
],
value
=>
{
if
(
_
.
isEmpty
(
result
[
0
]))
{
result
[
0
]
=
[];
}
_
.
forEach
(
_
.
slice
(
result
[
0
],
0
,
12
),
value
=>
{
if
(
value
.
keyword
===
params
.
query
)
{
return
;
}
...
...
Please
register
or
login
to post a comment