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
8f3bef09
Commit
8f3bef09
authored
May 13, 2015
by
thomascorthals
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from thomascorthals/master
Added support for facet.contains and facet.contains.ignoreCase
parents
df289677
4b741fae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
1 deletion
+107
-1
library/Solarium/Core/Client/Adapter/Curl.php
library/Solarium/Core/Client/Adapter/Curl.php
+1
-1
library/Solarium/QueryType/Select/Query/Component/Facet/Field.php
...Solarium/QueryType/Select/Query/Component/Facet/Field.php
+51
-0
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
...ry/Solarium/QueryType/Select/Query/Component/FacetSet.php
+51
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
...um/QueryType/Select/RequestBuilder/Component/FacetSet.php
+4
-0
No files found.
library/Solarium/Core/Client/Adapter/Curl.php
View file @
8f3bef09
...
@@ -156,7 +156,7 @@ class Curl extends Configurable implements AdapterInterface
...
@@ -156,7 +156,7 @@ class Curl extends Configurable implements AdapterInterface
}
}
if
(
!
isset
(
$options
[
'headers'
][
'Content-Type'
]))
{
if
(
!
isset
(
$options
[
'headers'
][
'Content-Type'
]))
{
$options
[
'headers'
][
'Content-Type'
]
=
'
text/xml; charset=utf-8
'
;
$options
[
'headers'
][
'Content-Type'
]
=
''
;
}
}
// Try endpoint authentication first, fallback to request for backwards compatibility
// Try endpoint authentication first, fallback to request for backwards compatibility
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/Field.php
View file @
8f3bef09
...
@@ -151,6 +151,57 @@ class Field extends Facet
...
@@ -151,6 +151,57 @@ class Field extends Facet
return
$this
->
getOption
(
'prefix'
);
return
$this
->
getOption
(
'prefix'
);
}
}
/**
* Limit the terms for faceting by a string they must contain
*
* This is a global value for all facets in this facetset
*
* @param string $contains
* @return self Provides fluent interface
*/
public
function
setContains
(
$contains
)
{
return
$this
->
setOption
(
'contains'
,
$contains
);
}
/**
* Get the facet contains
*
* This is a global value for all facets in this facetset
*
* @return string
*/
public
function
getContains
()
{
return
$this
->
getOption
(
'contains'
);
}
/**
* Case sensitivity of matching string that facet terms must contain
*
* This is a global value for all facets in this facetset
*
* @param boolean $containsIgnoreCase
* @return self Provides fluent interface
*/
public
function
setContainsIgnoreCase
(
$containsIgnoreCase
)
{
return
$this
->
setOption
(
'contains.ignoreCase'
,
$containsIgnoreCase
);
}
/**
* Get the case sensitivity of facet contains
*
* This is a global value for all facets in this facetset
*
* @return boolean
*/
public
function
getContainsIgnoreCase
()
{
return
$this
->
getOption
(
'contains.ignoreCase'
);
}
/**
/**
* Set the facet limit
* Set the facet limit
*
*
...
...
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
View file @
8f3bef09
...
@@ -202,6 +202,57 @@ class FacetSet extends Component
...
@@ -202,6 +202,57 @@ class FacetSet extends Component
return
$this
->
getOption
(
'prefix'
);
return
$this
->
getOption
(
'prefix'
);
}
}
/**
* Limit the terms for faceting by a string they must contain
*
* This is a global value for all facets in this facetset
*
* @param string $contains
* @return self Provides fluent interface
*/
public
function
setContains
(
$contains
)
{
return
$this
->
setOption
(
'contains'
,
$contains
);
}
/**
* Get the facet contains
*
* This is a global value for all facets in this facetset
*
* @return string
*/
public
function
getContains
()
{
return
$this
->
getOption
(
'contains'
);
}
/**
* Case sensitivity of matching string that facet terms must contain
*
* This is a global value for all facets in this facetset
*
* @param boolean $containsIgnoreCase
* @return self Provides fluent interface
*/
public
function
setContainsIgnoreCase
(
$containsIgnoreCase
)
{
return
$this
->
setOption
(
'contains.ignoreCase'
,
$containsIgnoreCase
);
}
/**
* Get the case sensitivity of facet contains
*
* This is a global value for all facets in this facetset
*
* @return boolean
*/
public
function
getContainsIgnoreCase
()
{
return
$this
->
getOption
(
'contains.ignoreCase'
);
}
/**
/**
* Set the facet sort order
* Set the facet sort order
*
*
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
View file @
8f3bef09
...
@@ -72,6 +72,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
...
@@ -72,6 +72,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
// global facet params
// global facet params
$request
->
addParam
(
'facet.sort'
,
$component
->
getSort
());
$request
->
addParam
(
'facet.sort'
,
$component
->
getSort
());
$request
->
addParam
(
'facet.prefix'
,
$component
->
getPrefix
());
$request
->
addParam
(
'facet.prefix'
,
$component
->
getPrefix
());
$request
->
addParam
(
'facet.contains'
,
$component
->
getContains
());
$request
->
addParam
(
'facet.contains.ignoreCase'
,
is_null
(
$ignoreCase
=
$component
->
getContainsIgnoreCase
())
?
null
:
(
$ignoreCase
?
'true'
:
'false'
));
$request
->
addParam
(
'facet.missing'
,
$component
->
getMissing
());
$request
->
addParam
(
'facet.missing'
,
$component
->
getMissing
());
$request
->
addParam
(
'facet.mincount'
,
$component
->
getMinCount
());
$request
->
addParam
(
'facet.mincount'
,
$component
->
getMinCount
());
$request
->
addParam
(
'facet.limit'
,
$component
->
getLimit
());
$request
->
addParam
(
'facet.limit'
,
$component
->
getLimit
());
...
@@ -124,6 +126,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
...
@@ -124,6 +126,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
$request
->
addParam
(
"f.
$field
.facet.limit"
,
$facet
->
getLimit
());
$request
->
addParam
(
"f.
$field
.facet.limit"
,
$facet
->
getLimit
());
$request
->
addParam
(
"f.
$field
.facet.sort"
,
$facet
->
getSort
());
$request
->
addParam
(
"f.
$field
.facet.sort"
,
$facet
->
getSort
());
$request
->
addParam
(
"f.
$field
.facet.prefix"
,
$facet
->
getPrefix
());
$request
->
addParam
(
"f.
$field
.facet.prefix"
,
$facet
->
getPrefix
());
$request
->
addParam
(
"f.
$field
.facet.contains"
,
$facet
->
getContains
());
$request
->
addParam
(
"f.
$field
.facet.contains.ignoreCase"
,
is_null
(
$ignoreCase
=
$facet
->
getContainsIgnoreCase
())
?
null
:
(
$ignoreCase
?
'true'
:
'false'
));
$request
->
addParam
(
"f.
$field
.facet.offset"
,
$facet
->
getOffset
());
$request
->
addParam
(
"f.
$field
.facet.offset"
,
$facet
->
getOffset
());
$request
->
addParam
(
"f.
$field
.facet.mincount"
,
$facet
->
getMinCount
());
$request
->
addParam
(
"f.
$field
.facet.mincount"
,
$facet
->
getMinCount
());
$request
->
addParam
(
"f.
$field
.facet.missing"
,
$facet
->
getMissing
());
$request
->
addParam
(
"f.
$field
.facet.missing"
,
$facet
->
getMissing
());
...
...
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