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
df03b4da
Commit
df03b4da
authored
Apr 16, 2015
by
Greg Eisenman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collations and correctlySpelled issue #320.
parent
45ed4658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
.../QueryType/Select/ResponseParser/Component/Spellcheck.php
+26
-0
No files found.
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
View file @
df03b4da
...
...
@@ -96,6 +96,32 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
}
}
/*
* https://issues.apache.org/jira/browse/SOLR-3029
* Solr5 has moved collations and correctlySpelled
* directly under spellcheck.
*/
if
(
isset
(
$data
[
'spellcheck'
][
'collations'
])
&&
!
isset
(
$collations
)
&&
is_array
(
$data
[
'spellcheck'
][
'collations'
])
)
{
foreach
(
$data
[
'spellcheck'
][
'collations'
]
as
$collationResult
)
{
if
(
is_array
(
$collationResult
))
{
$collation
=
array
();
foreach
(
$collationResult
as
$key
=>
$value
)
{
$collation
=
array_merge
(
$collation
,
array
(
$key
,
$value
));
}
$collations
=
array_merge
(
$collations
,
$this
->
parseCollation
(
$query
,
$collation
));
}
}
}
if
(
isset
(
$data
[
'spellcheck'
][
'correctlySpelled'
])
&&
!
isset
(
$correctlySpelled
)
)
{
$correctlySpelled
=
$data
[
'spellcheck'
][
'correctlySpelled'
];
}
return
new
SpellcheckResult\Result
(
$suggestions
,
$collations
,
$correctlySpelled
);
}
else
{
return
null
;
...
...
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