Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
973a2347
Commit
973a2347
authored
Aug 16, 2011
by
Gasol Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MoreLikeThis aways sort by score, remove score functionality
parent
26494c33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
108 deletions
+0
-108
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
+0
-9
library/Solarium/Query/MoreLikeThis.php
library/Solarium/Query/MoreLikeThis.php
+0
-99
No files found.
library/Solarium/Client/RequestBuilder/MoreLikeThis.php
View file @
973a2347
...
...
@@ -71,15 +71,6 @@ class Solarium_Client_RequestBuilder_MoreLikeThis extends Solarium_Client_Reques
$request
->
addParam
(
'mlt.match.include'
,
$query
->
getMatchInclude
());
$request
->
addParam
(
'mlt.match.offset'
,
$query
->
getStart
());
// add sort fields to request
$sort
=
array
();
foreach
(
$query
->
getSorts
()
AS
$field
=>
$order
)
{
$sort
[]
=
$field
.
' '
.
$order
;
}
if
(
count
(
$sort
)
!==
0
)
{
$request
->
addParam
(
'sort'
,
implode
(
','
,
$sort
));
}
// add filterqueries to request
$filterQueries
=
$query
->
getFilterQueries
();
if
(
count
(
$filterQueries
)
!==
0
)
{
...
...
library/Solarium/Query/MoreLikeThis.php
View file @
973a2347
...
...
@@ -49,12 +49,6 @@
class
Solarium_Query_MoreLikeThis
extends
Solarium_Query
{
/**
* Solr sort modes
*/
const
SORT_DESC
=
'desc'
;
const
SORT_ASC
=
'asc'
;
/**
* Query components
*/
...
...
@@ -121,13 +115,6 @@ class Solarium_Query_MoreLikeThis extends Solarium_Query
*/
protected
$_fields
=
array
();
/**
* Items to sort on
*
* @var array
*/
protected
$_sorts
=
array
();
/**
* Filterqueries
*
...
...
@@ -160,9 +147,6 @@ class Solarium_Query_MoreLikeThis extends Solarium_Query
case
'filterquery'
:
$this
->
addFilterQueries
(
$value
);
break
;
case
'sort'
:
$this
->
addSorts
(
$value
);
break
;
case
'fields'
:
$this
->
addFields
(
$value
);
break
;
...
...
@@ -433,89 +417,6 @@ class Solarium_Query_MoreLikeThis extends Solarium_Query
return
$this
;
}
/**
* Add a sort
*
* @param string $sort
* @param string $order
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
addSort
(
$sort
,
$order
)
{
$this
->
_sorts
[
$sort
]
=
$order
;
return
$this
;
}
/**
* Add multiple sorts
*
* The input array must contain sort items as keys and the order as values.
*
* @param array $sorts
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
addSorts
(
array
$sorts
)
{
foreach
(
$sorts
AS
$sort
=>
$order
)
{
$this
->
addSort
(
$sort
,
$order
);
}
return
$this
;
}
/**
* Remove a sort
*
* @param string $sort
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
removeSort
(
$sort
)
{
if
(
isset
(
$this
->
_sorts
[
$sort
]))
{
unset
(
$this
->
_sorts
[
$sort
]);
}
return
$this
;
}
/**
* Remove all sorts
*
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
clearSorts
()
{
$this
->
_sorts
=
array
();
return
$this
;
}
/**
* Get a list of the sorts
*
* @return array
*/
public
function
getSorts
()
{
return
$this
->
_sorts
;
}
/**
* Set multiple sorts
*
* This overwrites any existing sorts
*
* @param array $sorts
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
setSorts
(
$sorts
)
{
$this
->
clearSorts
();
$this
->
addSorts
(
$sorts
);
return
$this
;
}
/**
* Create a filterquery instance
*
...
...
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