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
a7ff6fa6
Commit
a7ff6fa6
authored
Jul 13, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/nextgen
parents
f25ca7e7
6981a90c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
0 deletions
+79
-0
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
...Type/Select/Query/Component/Highlighting/Highlighting.php
+51
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/Highlighting.php
...ueryType/Select/RequestBuilder/Component/Highlighting.php
+2
-0
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
.../Select/Query/Component/Highlighting/HighlightingTest.php
+22
-0
tests/Solarium/Tests/QueryType/Select/RequestBuilder/Component/HighlightingTest.php
...Type/Select/RequestBuilder/Component/HighlightingTest.php
+4
-0
No files found.
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
View file @
a7ff6fa6
...
@@ -467,6 +467,57 @@ class Highlighting extends Component
...
@@ -467,6 +467,57 @@ class Highlighting extends Component
{
{
return
$this
->
getOption
(
'simplepostfix'
);
return
$this
->
getOption
(
'simplepostfix'
);
}
}
/**
* Set tag prefix option
*
* Solr option h1.tag.post
*
* @param string $prefix
* @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
*/
public
function
setTagPrefix
(
$prefix
)
{
return
$this
->
_setOption
(
'tagprefix'
,
$prefix
);
}
/**
* Get tag prefix option
*
* Solr option hl.tag.pre
*
* @return string|null
*/
public
function
getTagPrefix
()
{
return
$this
->
getOption
(
'tagprefix'
);
}
/**
* Set tag postfix option
*
* Solr option h1.tag.post
*
* @param string $postfix
* @return Solarium_Query_Select_Component_Highlighting Provides fluent interface
*/
public
function
setTagPostfix
(
$postfix
)
{
return
$this
->
_setOption
(
'tagpostfix'
,
$postfix
);
}
/**
* Get tag postfix option
*
* Solr option hl.tag.post
*
* @return string|null
*/
public
function
getTagPostfix
()
{
return
$this
->
getOption
(
'tagpostfix'
);
}
/**
/**
* Set fragmenter option
* Set fragmenter option
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Highlighting.php
View file @
a7ff6fa6
...
@@ -71,6 +71,8 @@ class Highlighting
...
@@ -71,6 +71,8 @@ class Highlighting
$request
->
addParam
(
'hl.formatter'
,
$component
->
getFormatter
());
$request
->
addParam
(
'hl.formatter'
,
$component
->
getFormatter
());
$request
->
addParam
(
'hl.simple.pre'
,
$component
->
getSimplePrefix
());
$request
->
addParam
(
'hl.simple.pre'
,
$component
->
getSimplePrefix
());
$request
->
addParam
(
'hl.simple.post'
,
$component
->
getSimplePostfix
());
$request
->
addParam
(
'hl.simple.post'
,
$component
->
getSimplePostfix
());
$request
->
addParam
(
'hl.tag.pre'
,
$component
->
getTagPrefix
());
$request
->
addParam
(
'hl.tag.post'
,
$component
->
getTagPostfix
());
$request
->
addParam
(
'hl.fragmenter'
,
$component
->
getFragmenter
());
$request
->
addParam
(
'hl.fragmenter'
,
$component
->
getFragmenter
());
$request
->
addParam
(
'hl.fragListBuilder'
,
$component
->
getFragListBuilder
());
$request
->
addParam
(
'hl.fragListBuilder'
,
$component
->
getFragListBuilder
());
$request
->
addParam
(
'hl.fragmentsBuilder'
,
$component
->
getFragmentsBuilder
());
$request
->
addParam
(
'hl.fragmentsBuilder'
,
$component
->
getFragmentsBuilder
());
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
View file @
a7ff6fa6
...
@@ -487,4 +487,26 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
...
@@ -487,4 +487,26 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
);
);
}
}
public
function
testSetAndGetTagPrefix
()
{
$value
=
'<i>'
;
$this
->
_hlt
->
setTagPrefix
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_hlt
->
getTagPrefix
()
);
}
public
function
testSetAndGetTagPostfix
()
{
$value
=
'</i>'
;
$this
->
_hlt
->
setTagPostfix
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_hlt
->
getTagPostfix
()
);
}
}
}
tests/Solarium/Tests/QueryType/Select/RequestBuilder/Component/HighlightingTest.php
View file @
a7ff6fa6
...
@@ -77,6 +77,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
...
@@ -77,6 +77,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
$component
->
setMaxAnalyzedChars
(
100
);
$component
->
setMaxAnalyzedChars
(
100
);
$component
->
setQuery
(
'text:myvalue'
);
$component
->
setQuery
(
'text:myvalue'
);
$component
->
setPhraseLimit
(
40
);
$component
->
setPhraseLimit
(
40
);
$component
->
setTagPrefix
(
'<i>'
);
$component
->
setTagPostfix
(
'</i>'
);
$request
=
$builder
->
buildComponent
(
$component
,
$request
);
$request
=
$builder
->
buildComponent
(
$component
,
$request
);
...
@@ -94,6 +96,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
...
@@ -94,6 +96,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
'hl.formatter'
=>
'simple'
,
'hl.formatter'
=>
'simple'
,
'hl.simple.pre'
=>
'<b>'
,
'hl.simple.pre'
=>
'<b>'
,
'hl.simple.post'
=>
'</b>'
,
'hl.simple.post'
=>
'</b>'
,
'hl.tag.pre'
=>
'<i>'
,
'hl.tag.post'
=>
'</i>'
,
'hl.fragmenter'
=>
'myFragmenter'
,
'hl.fragmenter'
=>
'myFragmenter'
,
'hl.fragListBuilder'
=>
'myFragListBuilder'
,
'hl.fragListBuilder'
=>
'myFragListBuilder'
,
'hl.fragmentsBuilder'
=>
'myFragmentsBuilder'
,
'hl.fragmentsBuilder'
=>
'myFragmentsBuilder'
,
...
...
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