Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
solr-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
56bc02c4
authored
2016-11-02 15:19:53 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Facets needs to do a direct call to look up suggestions, so make it use
the same sync method as Solr.
1 parent
d5e4a434
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
src/scripts/solr/model/Solr.js
src/scripts/solr/model/Solr.js
View file @
56bc02c
...
...
@@ -149,12 +149,17 @@ define(function(require) {
return
this
;
},
initialize
:
function
(
data
,
options
)
{
var
solr
=
this
;
options
=
(
options
||
{});
this
.
set
(
'options'
,
this
.
_options
=
new
Backbone
.
Model
({
faceting
:
!!
options
.
faceting
,
highlighting
:
!!
options
.
highlighting
,
showAll
:
!!
options
.
showAll
,
}));
var
facets
=
this
.
get
(
'facets'
);
facets
.
sync
=
function
sync
()
{
return
solr
.
sync
.
apply
(
this
,
arguments
);
};
this
.
_doSearchImmediately
=
_
.
bind
(
function
(
options
)
{
this
.
buildQueryParameters
();
this
.
fetch
(
_
.
extend
({},
options
,
{
...
...
@@ -195,7 +200,7 @@ define(function(require) {
this
.
on
(
'change:currentPage'
,
function
(
model
,
value
,
options
)
{
this
.
_doSearch
(
options
);
},
this
);
this
.
get
(
'facets'
)
.
on
(
'item-change'
,
function
(
model
,
value
,
options
)
{
facets
.
on
(
'item-change'
,
function
(
model
,
value
,
options
)
{
this
.
_doSearch
(
_
.
extend
({},
options
,
{
resetCurrentPage
:
true
}));
},
this
);
this
.
get
(
'ordering'
).
on
(
'change:value'
,
function
(
model
,
value
,
options
)
{
...
...
Please
register
or
sign in
to post a comment