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
2b3eb876
Commit
2b3eb876
authored
Jul 26, 2013
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:basdenooijer/solarium into develop
parents
042620b6
b5bf3b5a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
...ueryType/Select/ResponseParser/Component/MoreLikeThis.php
+1
-1
library/Solarium/QueryType/Select/Result/MoreLikeThis/Result.php
.../Solarium/QueryType/Select/Result/MoreLikeThis/Result.php
+1
-1
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/MoreLikeThisTest.php
...Type/Select/ResponseParser/Component/MoreLikeThisTest.php
+24
-0
No files found.
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
View file @
2b3eb876
...
@@ -74,7 +74,7 @@ class MoreLikeThis implements ComponentParserInterface
...
@@ -74,7 +74,7 @@ class MoreLikeThis implements ComponentParserInterface
$results
[
$key
]
=
new
Result
(
$results
[
$key
]
=
new
Result
(
$result
[
'numFound'
],
$result
[
'numFound'
],
$result
[
'maxScore'
]
,
isset
(
$result
[
'maxScore'
])
?
$result
[
'maxScore'
]
:
null
,
$docs
$docs
);
);
}
}
...
...
library/Solarium/QueryType/Select/Result/MoreLikeThis/Result.php
View file @
2b3eb876
...
@@ -72,7 +72,7 @@ class Result implements \IteratorAggregate, \Countable
...
@@ -72,7 +72,7 @@ class Result implements \IteratorAggregate, \Countable
* Constructor
* Constructor
*
*
* @param int $numFound
* @param int $numFound
* @param float $maxScore
* @param float
|null
$maxScore
* @param array $documents
* @param array $documents
* @return void
* @return void
*/
*/
...
...
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/MoreLikeThisTest.php
View file @
2b3eb876
...
@@ -77,4 +77,28 @@ class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
...
@@ -77,4 +77,28 @@ class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
array
(),
$result
->
getResults
());
$this
->
assertEquals
(
array
(),
$result
->
getResults
());
}
}
public
function
testParseWithoutMaxScore
()
{
$query
=
new
Query
();
$data
=
array
(
'moreLikeThis'
=>
array
(
'id1'
=>
array
(
'numFound'
=>
12
,
'docs'
=>
array
(
array
(
'field1'
=>
'value1'
)
)
)
)
);
$docs
=
array
(
new
Document
(
array
(
'field1'
=>
'value1'
)));
$expected
=
array
(
'id1'
=>
new
Result
(
12
,
null
,
$docs
)
);
$result
=
$this
->
parser
->
parse
(
$query
,
null
,
$data
);
$this
->
assertEquals
(
$expected
,
$result
->
getResults
());
}
}
}
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