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
1bb6ec64
Commit
1bb6ec64
authored
Apr 18, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- small bugfixes and unittest improvements
parent
ad85fa03
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
library/Solarium/Client/Response/Select.php
library/Solarium/Client/Response/Select.php
+1
-1
library/Solarium/Query/Select/Component/MoreLikeThis.php
library/Solarium/Query/Select/Component/MoreLikeThis.php
+9
-9
tests/Solarium/Result/Select/MoreLikeThisTest.php
tests/Solarium/Result/Select/MoreLikeThisTest.php
+13
-0
tests/Solarium/Result/SelectTest.php
tests/Solarium/Result/SelectTest.php
+8
-0
No files found.
library/Solarium/Client/Response/Select.php
View file @
1bb6ec64
...
...
@@ -178,7 +178,7 @@ class Solarium_Client_Response_Select extends Solarium_Client_Response
$documentClass
=
$this
->
_query
->
getOption
(
'documentclass'
);
$searchResults
=
$this
->
_data
[
'moreLikeThis'
];
foreach
(
$searchResults
AS
$key
=>
$result
)
{
foreach
(
$searchResults
AS
$key
=>
$result
)
{
// create document instances
$docs
=
array
();
...
...
library/Solarium/Query/Select/Component/MoreLikeThis.php
View file @
1bb6ec64
...
...
@@ -85,7 +85,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setFields
(
$fields
)
{
return
$this
->
_setOption
(
'fields'
,
$fields
);
return
$this
->
_setOption
(
'fields'
,
$fields
);
}
/**
...
...
@@ -109,7 +109,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMinimumTermFrequency
(
$minimum
)
{
return
$this
->
_setOption
(
'minimumtermfrequency'
,
$minimum
);
return
$this
->
_setOption
(
'minimumtermfrequency'
,
$minimum
);
}
/**
...
...
@@ -133,7 +133,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMinimumDocumentFrequency
(
$minimum
)
{
return
$this
->
_setOption
(
'minimumdocumentfrequency'
,
$minimum
);
return
$this
->
_setOption
(
'minimumdocumentfrequency'
,
$minimum
);
}
/**
...
...
@@ -156,7 +156,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMinimumWordLength
(
$minimum
)
{
return
$this
->
_setOption
(
'minimumwordlength'
,
$minimum
);
return
$this
->
_setOption
(
'minimumwordlength'
,
$minimum
);
}
/**
...
...
@@ -179,7 +179,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMaximumWordLength
(
$maximum
)
{
return
$this
->
_setOption
(
'maximumwordlength'
,
$maximum
);
return
$this
->
_setOption
(
'maximumwordlength'
,
$maximum
);
}
/**
...
...
@@ -203,7 +203,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMaximumQueryTerms
(
$maximum
)
{
return
$this
->
_setOption
(
'maximumqueryterms'
,
$maximum
);
return
$this
->
_setOption
(
'maximumqueryterms'
,
$maximum
);
}
/**
...
...
@@ -227,7 +227,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setMaximumNumberOfTokens
(
$maximum
)
{
return
$this
->
_setOption
(
'maximumnumberoftokens'
,
$maximum
);
return
$this
->
_setOption
(
'maximumnumberoftokens'
,
$maximum
);
}
/**
...
...
@@ -250,7 +250,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setBoost
(
$boost
)
{
return
$this
->
_setOption
(
'boost'
,
$boost
);
return
$this
->
_setOption
(
'boost'
,
$boost
);
}
/**
...
...
@@ -276,7 +276,7 @@ class Solarium_Query_Select_Component_MoreLikeThis
*/
public
function
setQueryFields
(
$queryFields
)
{
return
$this
->
_setOption
(
'queryfields'
,
$queryFields
);
return
$this
->
_setOption
(
'queryfields'
,
$queryFields
);
}
/**
...
...
tests/Solarium/Result/Select/MoreLikeThisTest.php
View file @
1bb6ec64
...
...
@@ -67,6 +67,14 @@ class Solarium_Result_Select_MoreLikeThisTest extends PHPUnit_Framework_TestCase
);
}
public
function
testGetInvalidResult
()
{
$this
->
assertEquals
(
null
,
$this
->
_mlt
->
getResult
(
'invalid'
)
);
}
public
function
testIterator
()
{
$items
=
array
();
...
...
@@ -78,4 +86,9 @@ class Solarium_Result_Select_MoreLikeThisTest extends PHPUnit_Framework_TestCase
$this
->
assertEquals
(
$this
->
_results
,
$items
);
}
public
function
testCount
()
{
$this
->
assertEquals
(
count
(
$this
->
_results
),
count
(
$this
->
_mlt
));
}
}
tests/Solarium/Result/SelectTest.php
View file @
1bb6ec64
...
...
@@ -97,6 +97,14 @@ class Solarium_Result_SelectTest extends Solarium_Result_QueryTest
);
}
public
function
testGetInvalidComponent
()
{
$this
->
assertEquals
(
null
,
$this
->
_result
->
getComponent
(
'invalid'
)
);
}
public
function
testGetMoreLikeThis
()
{
$this
->
assertEquals
(
...
...
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