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
c2eb9af5
Commit
c2eb9af5
authored
Jul 26, 2013
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue #184
parent
e33e7915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
examples/2.1.5.9-spellcheck.php
examples/2.1.5.9-spellcheck.php
+4
-4
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
.../QueryType/Select/ResponseParser/Component/Spellcheck.php
+9
-7
No files found.
examples/2.1.5.9-spellcheck.php
View file @
c2eb9af5
...
...
@@ -50,11 +50,11 @@ echo '<h1>Collations</h1>';
foreach
(
$collations
as
$collation
)
{
echo
'Query: '
.
$collation
->
getQuery
()
.
'<br/>'
;
echo
'Hits: '
.
$collation
->
getHits
()
.
'<br/>'
;
echo
'Corrections:<br/>'
;
foreach
(
$collation
->
getCorrections
()
as
$input
=>
$correction
)
{
echo
$input
.
' => '
.
$correction
.
'<br/>'
;
}
echo
'<hr/>'
;
}
echo
'Corrections:<br/>'
;
foreach
(
$collation
->
getCorrections
()
as
$input
=>
$correction
)
{
echo
$input
.
' => '
.
$correction
.
'<br/>'
;
}
htmlFooter
();
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
View file @
c2eb9af5
...
...
@@ -183,14 +183,16 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$originalFrequency
=
(
isset
(
$value
[
'origFreq'
]))
?
$value
[
'origFreq'
]
:
null
;
$words
=
array
();
foreach
(
$value
[
'suggestion'
]
as
$suggestion
)
{
if
(
is_string
(
$suggestion
))
{
$suggestion
=
array
(
'word'
=>
$suggestion
,
'freq'
=>
null
,
);
if
(
isset
(
$value
[
'suggestion'
])
&&
is_array
(
$value
[
'suggestion'
]))
{
foreach
(
$value
[
'suggestion'
]
as
$suggestion
)
{
if
(
is_string
(
$suggestion
))
{
$suggestion
=
array
(
'word'
=>
$suggestion
,
'freq'
=>
null
,
);
}
$words
[]
=
$suggestion
;
}
$words
[]
=
$suggestion
;
}
return
new
Suggestion
(
...
...
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