Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
ba16b1c6
Commit
ba16b1c6
authored
Sep 16, 2013
by
Ujvari Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor: facet rename created to since, limit to results
parent
6750a985
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
streamsearch.coffee
h/js/streamsearch.coffee
+11
-11
No files found.
h/js/streamsearch.coffee
View file @
ba16b1c6
...
...
@@ -29,7 +29,7 @@ class SearchHelper
category
=
searchItem
.
attributes
.
category
value
=
searchItem
.
attributes
.
value
if
category
is
'
limit
'
then
limit
=
value
if
category
is
'
results
'
then
limit
=
value
else
if
category
is
'text'
# Visualsearch sickly automatically cluster the text field
...
...
@@ -81,11 +81,11 @@ class SearchHelper
value_part
=
if
rule
.
formatter
then
rule
.
formatter
val
else
val
filter
.
addClause
mapped_field
,
oper_part
,
value_part
,
case_sensitive
if
limit
!=
50
then
categories
[
'
limit
'
]
=
[
limit
]
if
limit
!=
50
then
categories
[
'
results
'
]
=
[
limit
]
[
filter
.
getFilter
(),
categories
]
class
StreamSearch
facets
:
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
created'
,
'user'
,
'limit
'
]
facets
:
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
since'
,
'user'
,
'results
'
]
rules
:
user
:
formatter
:
(
user
)
->
...
...
@@ -120,7 +120,7 @@ class StreamSearch
exact_match
:
false
case_sensitive
:
false
and_or
:
'or'
created
:
since
:
formatter
:
(
past
)
->
seconds
=
switch
past
...
...
@@ -191,22 +191,22 @@ class StreamSearch
add_limit
=
true
add_created
=
true
for
facet
in
@
search
.
searchQuery
.
facets
()
if
facet
.
hasOwnProperty
'
limit
'
then
add_limit
=
false
if
facet
.
hasOwnProperty
'
created
'
then
add_created
=
false
if
facet
.
hasOwnProperty
'
results
'
then
add_limit
=
false
if
facet
.
hasOwnProperty
'
since
'
then
add_created
=
false
if
add_limit
and
add_created
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
created'
,
'user'
,
'limit
'
]
if
add_limit
and
add_created
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
since'
,
'user'
,
'results
'
]
else
if
add_limit
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'user'
,
'
limit
'
]
if
add_limit
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'user'
,
'
results
'
]
else
if
add_created
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
created
'
,
'user'
]
if
add_created
then
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'
since
'
,
'user'
]
else
list
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'user'
]
return
callback
list
,
{
preserveOrder
:
true
}
valueMatches
:
(
facet
,
searchTerm
,
callback
)
->
switch
facet
when
'
limit
'
when
'
results
'
callback
[
'0'
,
'10'
,
'25'
,
'50'
,
'100'
,
'250'
,
'1000'
]
when
'
created
'
when
'
since
'
callback
[
'5 min'
,
'30 min'
,
'1 hour'
,
'12 hours'
,
'1 day'
,
'1 week'
,
'1 month'
,
'1 year'
],
{
preserveOrder
:
true
}
clearSearch
:
(
original
)
=>
# Execute clearSearch's internal method for resetting search
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment