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
672f65f8
Commit
672f65f8
authored
Apr 21, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added dismax component
- added unittests for dismax component
parent
73ebbf44
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
497 additions
and
21 deletions
+497
-21
library/Solarium/Client/Request/Select.php
library/Solarium/Client/Request/Select.php
+25
-0
library/Solarium/Client/Response/Select.php
library/Solarium/Client/Response/Select.php
+4
-1
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+15
-0
library/Solarium/Query/Select/Component.php
library/Solarium/Query/Select/Component.php
+1
-0
library/Solarium/Query/Select/Component/DisMax.php
library/Solarium/Query/Select/Component/DisMax.php
+278
-0
library/Solarium/Query/Select/Component/Facet/Range.php
library/Solarium/Query/Select/Component/Facet/Range.php
+2
-2
library/Solarium/Query/Select/Component/MoreLikeThis.php
library/Solarium/Query/Select/Component/MoreLikeThis.php
+0
-18
tests/Solarium/Query/Select/Component/DisMaxTest.php
tests/Solarium/Query/Select/Component/DisMaxTest.php
+152
-0
tests/Solarium/Query/Select/Component/FacetSetTest.php
tests/Solarium/Query/Select/Component/FacetSetTest.php
+5
-0
tests/Solarium/Query/Select/Component/MoreLikeThisTest.php
tests/Solarium/Query/Select/Component/MoreLikeThisTest.php
+5
-0
tests/Solarium/Query/SelectTest.php
tests/Solarium/Query/SelectTest.php
+10
-0
No files found.
library/Solarium/Client/Request/Select.php
View file @
672f65f8
...
@@ -90,6 +90,9 @@ class Solarium_Client_Request_Select extends Solarium_Client_Request
...
@@ -90,6 +90,9 @@ class Solarium_Client_Request_Select extends Solarium_Client_Request
case
Solarium_Query_Select_Component
::
FACETSET
:
case
Solarium_Query_Select_Component
::
FACETSET
:
$this
->
addFacetSet
(
$component
);
$this
->
addFacetSet
(
$component
);
break
;
break
;
case
Solarium_Query_Select_Component
::
DISMAX
:
$this
->
addDisMax
(
$component
);
break
;
default
:
default
:
throw
new
Solarium_Exception
(
'Unknown component type'
);
throw
new
Solarium_Exception
(
'Unknown component type'
);
}
}
...
@@ -254,4 +257,26 @@ class Solarium_Client_Request_Select extends Solarium_Client_Request
...
@@ -254,4 +257,26 @@ class Solarium_Client_Request_Select extends Solarium_Client_Request
$this
->
addParam
(
'mlt.count'
,
$component
->
getCount
());
$this
->
addParam
(
'mlt.count'
,
$component
->
getCount
());
}
}
/**
* Add params for DisMax
*
* @param Solarium_Query_Select_Component_DisMax $component
* @return void
*/
public
function
addDisMax
(
$component
)
{
// enable dismax
$this
->
_params
[
'defType'
]
=
'dismax'
;
$this
->
addParam
(
'q.alt'
,
$component
->
getQueryAlternative
());
$this
->
addParam
(
'qf'
,
$component
->
getQueryFields
());
$this
->
addParam
(
'mm'
,
$component
->
getMinimumMatch
());
$this
->
addParam
(
'pf'
,
$component
->
getPhraseFields
());
$this
->
addParam
(
'ps'
,
$component
->
getPhraseSlop
());
$this
->
addParam
(
'qs'
,
$component
->
getQueryPhraseSlop
());
$this
->
addParam
(
'tie'
,
$component
->
getTie
());
$this
->
addParam
(
'bq'
,
$component
->
getBoostQuery
());
$this
->
addParam
(
'bf'
,
$component
->
getBoostFunctions
());
}
}
}
\ No newline at end of file
library/Solarium/Client/Response/Select.php
View file @
672f65f8
...
@@ -92,6 +92,9 @@ class Solarium_Client_Response_Select extends Solarium_Client_Response
...
@@ -92,6 +92,9 @@ class Solarium_Client_Response_Select extends Solarium_Client_Response
case
Solarium_Query_Select_Component
::
FACETSET
:
case
Solarium_Query_Select_Component
::
FACETSET
:
$this
->
_addFacetSet
(
$component
);
$this
->
_addFacetSet
(
$component
);
break
;
break
;
case
Solarium_Query_Select_Component
::
DISMAX
:
// no result action needed
break
;
default
:
default
:
throw
new
Solarium_Exception
(
'Unknown component type'
);
throw
new
Solarium_Exception
(
'Unknown component type'
);
}
}
...
@@ -123,7 +126,7 @@ class Solarium_Client_Response_Select extends Solarium_Client_Response
...
@@ -123,7 +126,7 @@ class Solarium_Client_Response_Select extends Solarium_Client_Response
case
Solarium_Query_Select_Component_Facet
::
MULTIQUERY
:
case
Solarium_Query_Select_Component_Facet
::
MULTIQUERY
:
$this
->
_addFacetMultiQuery
(
$facet
);
$this
->
_addFacetMultiQuery
(
$facet
);
break
;
break
;
case
Solarium_Query_Select_Component_Facet
::
RANGE
:
case
Solarium_Query_Select_Component_Facet
::
RANGE
:
$this
->
_addFacetRange
(
$facet
);
$this
->
_addFacetRange
(
$facet
);
break
;
break
;
default
:
default
:
...
...
library/Solarium/Query/Select.php
View file @
672f65f8
...
@@ -565,6 +565,9 @@ class Solarium_Query_Select extends Solarium_Query
...
@@ -565,6 +565,9 @@ class Solarium_Query_Select extends Solarium_Query
case
Solarium_Query_Select_Component
::
FACETSET
:
case
Solarium_Query_Select_Component
::
FACETSET
:
$className
=
'Solarium_Query_Select_Component_FacetSet'
;
$className
=
'Solarium_Query_Select_Component_FacetSet'
;
break
;
break
;
case
Solarium_Query_Select_Component
::
DISMAX
:
$className
=
'Solarium_Query_Select_Component_DisMax'
;
break
;
default
:
default
:
throw
new
Solarium_Exception
(
'Cannot autoload unknown component: '
.
$key
);
throw
new
Solarium_Exception
(
'Cannot autoload unknown component: '
.
$key
);
}
}
...
@@ -644,4 +647,16 @@ class Solarium_Query_Select extends Solarium_Query
...
@@ -644,4 +647,16 @@ class Solarium_Query_Select extends Solarium_Query
return
$this
->
getComponent
(
Solarium_Query_Select_Component
::
FACETSET
,
true
);
return
$this
->
getComponent
(
Solarium_Query_Select_Component
::
FACETSET
,
true
);
}
}
/**
* Get a DisMax component instance
*
* This is a convenience method that maps presets to getComponent
*
* @return Solarium_Query_Select_Component_DisMax
*/
public
function
getDisMax
()
{
return
$this
->
getComponent
(
Solarium_Query_Select_Component
::
DISMAX
,
true
);
}
}
}
\ No newline at end of file
library/Solarium/Query/Select/Component.php
View file @
672f65f8
...
@@ -49,6 +49,7 @@ class Solarium_Query_Select_Component extends Solarium_Configurable
...
@@ -49,6 +49,7 @@ class Solarium_Query_Select_Component extends Solarium_Configurable
*/
*/
const
MORELIKETHIS
=
'morelikethis'
;
const
MORELIKETHIS
=
'morelikethis'
;
const
FACETSET
=
'facetset'
;
const
FACETSET
=
'facetset'
;
const
DISMAX
=
'dismax'
;
/**
/**
* Component type
* Component type
...
...
library/Solarium/Query/Select/Component/DisMax.php
0 → 100644
View file @
672f65f8
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
*
* @package Solarium
* @subpackage Query
*/
/**
* DisMax component
*
* @link http://wiki.apache.org/solr/DisMaxQParserPlugin
*
* @package Solarium
* @subpackage Query
*/
class
Solarium_Query_Select_Component_DisMax
extends
Solarium_Query_Select_Component
{
/**
* Component type
*
* @var string
*/
protected
$_type
=
self
::
DISMAX
;
/**
* Set QueryAlternative option
*
* If specified, this query will be used (and parsed by default using
* standard query parsing syntax) when the main query string is not
* specified or blank.
*
* @param string $queryAlternative
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setQueryAlternative
(
$queryAlternative
)
{
return
$this
->
_setOption
(
'queryalternative'
,
$queryAlternative
);
}
/**
* Get QueryAlternative option
*
* @return string|null
*/
public
function
getQueryAlternative
()
{
return
$this
->
getOption
(
'queryalternative'
);
}
/**
* Set QueryFields option
*
* List of fields and the "boosts" to associate with each of them when
* building DisjunctionMaxQueries from the user's query.
*
* The format supported is "fieldOne^2.3 fieldTwo fieldThree^0.4"
*
* @param string $queryFields
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setQueryFields
(
$queryFields
)
{
return
$this
->
_setOption
(
'queryfields'
,
$queryFields
);
}
/**
* Get QueryFields option
*
* @return string|null
*/
public
function
getQueryFields
()
{
return
$this
->
getOption
(
'queryfields'
);
}
/**
* Set MinimumMatch option
*
* This option makes it possible to say that a certain minimum number of
* clauses must match. See Solr manual for details.
*
* @param string $minimumMatch
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setMinimumMatch
(
$minimumMatch
)
{
return
$this
->
_setOption
(
'minimummatch'
,
$minimumMatch
);
}
/**
* Get MinimumMatch option
*
* @return string|null
*/
public
function
getMinimumMatch
()
{
return
$this
->
getOption
(
'minimummatch'
);
}
/**
* Set PhraseFields option
*
* This param can be used to "boost" the score of documents in cases
* where all of the terms in the "q" param appear in close proximity.
*
* Format is: "fieldA^1.0 fieldB^2.2"
*
* @param string $phraseFields
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setPhraseFields
(
$phraseFields
)
{
return
$this
->
_setOption
(
'phrasefields'
,
$phraseFields
);
}
/**
* Get PhraseFields option
*
* @return string|null
*/
public
function
getPhraseFields
()
{
return
$this
->
getOption
(
'phrasefields'
);
}
/**
* Set PhraseSlop option
*
* Amount of slop on phrase queries built for "pf" fields
* (affects boosting)
*
* @param string $phraseSlop
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setPhraseSlop
(
$phraseSlop
)
{
return
$this
->
_setOption
(
'phraseslop'
,
$phraseSlop
);
}
/**
* Get PhraseSlop option
*
* @return string|null
*/
public
function
getPhraseSlop
()
{
return
$this
->
getOption
(
'phraseslop'
);
}
/**
* Set QueryPhraseSlop option
*
* Amount of slop on phrase queries explicitly included in the user's
* query string (in qf fields; affects matching)
*
* @param string $queryPhraseSlop
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setQueryPhraseSlop
(
$queryPhraseSlop
)
{
return
$this
->
_setOption
(
'queryphraseslop'
,
$queryPhraseSlop
);
}
/**
* Get QueryPhraseSlop option
*
* @return string|null
*/
public
function
getQueryPhraseSlop
()
{
return
$this
->
getOption
(
'queryphraseslop'
);
}
/**
* Set Tie option
*
* Float value to use as tiebreaker in DisjunctionMaxQueries
*
* @param float $tie
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setTie
(
$tie
)
{
return
$this
->
_setOption
(
'tie'
,
$tie
);
}
/**
* Get Tie option
*
* @return float|null
*/
public
function
getTie
()
{
return
$this
->
getOption
(
'tie'
);
}
/**
* Set BoostQuery option
*
* A raw query string (in the SolrQuerySyntax) that will be included
* with the user's query to influence the score.
*
* @param string $boostQuery
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setBoostQuery
(
$boostQuery
)
{
return
$this
->
_setOption
(
'boostquery'
,
$boostQuery
);
}
/**
* Get BoostQuery option
*
* @return string|null
*/
public
function
getBoostQuery
()
{
return
$this
->
getOption
(
'boostquery'
);
}
/**
* Set BoostFunctions option
*
* Functions (with optional boosts) that will be included in the
* user's query to influence the score.
*
* Format is: "funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2"
*
* @param string $boostFunctions
* @return Solarium_Query_Component_DisMax Provides fluent interface
*/
public
function
setBoostFunctions
(
$boostFunctions
)
{
return
$this
->
_setOption
(
'boostfunctions'
,
$boostFunctions
);
}
/**
* Get BoostFunctions option
*
* @return string|null
*/
public
function
getBoostFunctions
()
{
return
$this
->
getOption
(
'boostfunctions'
);
}
}
\ No newline at end of file
library/Solarium/Query/Select/Component/Facet/Range.php
View file @
672f65f8
...
@@ -220,7 +220,7 @@ class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_
...
@@ -220,7 +220,7 @@ class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_
public
function
setOther
(
$other
)
public
function
setOther
(
$other
)
{
{
if
(
is_array
(
$other
))
{
if
(
is_array
(
$other
))
{
$other
=
implode
(
','
,
$other
);
$other
=
implode
(
','
,
$other
);
}
}
return
$this
->
_setOption
(
'other'
,
$other
);
return
$this
->
_setOption
(
'other'
,
$other
);
...
@@ -250,7 +250,7 @@ class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_
...
@@ -250,7 +250,7 @@ class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_
public
function
setInclude
(
$include
)
public
function
setInclude
(
$include
)
{
{
if
(
is_array
(
$include
))
{
if
(
is_array
(
$include
))
{
$include
=
implode
(
','
,
$include
);
$include
=
implode
(
','
,
$include
);
}
}
return
$this
->
_setOption
(
'include'
,
$include
);
return
$this
->
_setOption
(
'include'
,
$include
);
...
...
library/Solarium/Query/Select/Component/MoreLikeThis.php
View file @
672f65f8
...
@@ -53,24 +53,6 @@ class Solarium_Query_Select_Component_MoreLikeThis extends Solarium_Query_Select
...
@@ -53,24 +53,6 @@ class Solarium_Query_Select_Component_MoreLikeThis extends Solarium_Query_Select
*/
*/
protected
$_type
=
self
::
MORELIKETHIS
;
protected
$_type
=
self
::
MORELIKETHIS
;
/**
* Default options
*
* @var array
*/
protected
$_options
=
array
(
'fields'
=>
null
,
'minimumtermfrequency'
=>
null
,
'minimumdocumentfrequency'
=>
null
,
'minimumwordlength'
=>
null
,
'maximumwordlength'
=>
null
,
'maximumqueryterms'
=>
null
,
'maximumnumberoftokens'
=>
null
,
'boost'
=>
null
,
'queryfields'
=>
null
,
'count'
=>
null
,
);
/**
/**
* Set fields option
* Set fields option
*
*
...
...
tests/Solarium/Query/Select/Component/DisMaxTest.php
0 → 100644
View file @
672f65f8
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class
Solarium_Query_Select_Component_DisMaxTest
extends
PHPUnit_Framework_TestCase
{
/**
* @var Solarium_Query_Select_Component_DisMax
*/
protected
$_disMax
;
public
function
setUp
()
{
$this
->
_disMax
=
new
Solarium_Query_Select_Component_DisMax
;
}
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component
::
DISMAX
,
$this
->
_disMax
->
getType
()
);
}
public
function
testSetAndGetQueryAlternative
()
{
$value
=
'*:*'
;
$this
->
_disMax
->
setQueryAlternative
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getQueryAlternative
()
);
}
public
function
testSetAndGetQueryFields
()
{
$value
=
'title^2.0 description'
;
$this
->
_disMax
->
setQueryFields
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getQueryFields
()
);
}
public
function
testSetAndGetMinimumMatch
()
{
$value
=
'2.0'
;
$this
->
_disMax
->
setMinimumMatch
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getMinimumMatch
()
);
}
public
function
testSetAndGetPhraseFields
()
{
$value
=
'title^2.0 description^3.5'
;
$this
->
_disMax
->
setPhraseFields
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getPhraseFields
()
);
}
public
function
testSetAndGetPhraseSlop
()
{
$value
=
'2'
;
$this
->
_disMax
->
setPhraseSlop
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getPhraseSlop
()
);
}
public
function
testSetAndGetQueryPhraseSlop
()
{
$value
=
'3'
;
$this
->
_disMax
->
setQueryPhraseSlop
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getQueryPhraseSlop
()
);
}
public
function
testSetAndGetTie
()
{
$value
=
2.1
;
$this
->
_disMax
->
setTie
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getTie
()
);
}
public
function
testSetAndGetBoostQuery
()
{
$value
=
'cat:1^3'
;
$this
->
_disMax
->
setBoostQuery
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getBoostQuery
()
);
}
public
function
testSetAndGetBoostFunctions
()
{
$value
=
'funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2'
;
$this
->
_disMax
->
setBoostFunctions
(
$value
);
$this
->
assertEquals
(
$value
,
$this
->
_disMax
->
getBoostFunctions
()
);
}
}
tests/Solarium/Query/Select/Component/FacetSetTest.php
View file @
672f65f8
...
@@ -39,6 +39,11 @@ class Solarium_Query_Select_Component_FacetSetTest extends PHPUnit_Framework_Tes
...
@@ -39,6 +39,11 @@ class Solarium_Query_Select_Component_FacetSetTest extends PHPUnit_Framework_Tes
$this
->
_facetSet
=
new
Solarium_Query_Select_Component_FacetSet
;
$this
->
_facetSet
=
new
Solarium_Query_Select_Component_FacetSet
;
}
}
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component
::
FACETSET
,
$this
->
_facetSet
->
getType
());
}
public
function
testSetAndGetSort
()
public
function
testSetAndGetSort
()
{
{
$this
->
_facetSet
->
setSort
(
'index'
);
$this
->
_facetSet
->
setSort
(
'index'
);
...
...
tests/Solarium/Query/Select/Component/MoreLikeThisTest.php
View file @
672f65f8
...
@@ -39,6 +39,11 @@ class Solarium_Query_Select_Component_MoreLikeThisTest extends PHPUnit_Framework
...
@@ -39,6 +39,11 @@ class Solarium_Query_Select_Component_MoreLikeThisTest extends PHPUnit_Framework
$this
->
_mlt
=
new
Solarium_Query_Select_Component_MoreLikeThis
;
$this
->
_mlt
=
new
Solarium_Query_Select_Component_MoreLikeThis
;
}
}
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component
::
MORELIKETHIS
,
$this
->
_mlt
->
getType
());
}
public
function
testSetAndGetFields
()
public
function
testSetAndGetFields
()
{
{
$value
=
'name,description'
;
$value
=
'name,description'
;
...
...
tests/Solarium/Query/SelectTest.php
View file @
672f65f8
...
@@ -468,4 +468,14 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
...
@@ -468,4 +468,14 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
get_class
(
$mlt
)
get_class
(
$mlt
)
);
);
}
}
public
function
testGetDisMax
()
{
$dismax
=
$this
->
_query
->
getDisMax
();
$this
->
assertEquals
(
'Solarium_Query_Select_Component_DisMax'
,
get_class
(
$dismax
)
);
}
}
}
\ No newline at end of file
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