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
eaf45495
Commit
eaf45495
authored
Mar 05, 2017
by
Bas de Nooijer
Committed by
GitHub
Mar 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #485 from tonynelson19/patch-1
Performance updates for formatting values
parents
520eb82a
6b799756
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
library/Solarium/QueryType/Update/RequestBuilder.php
library/Solarium/QueryType/Update/RequestBuilder.php
+5
-6
No files found.
library/Solarium/QueryType/Update/RequestBuilder.php
View file @
eaf45495
...
...
@@ -229,10 +229,6 @@ class RequestBuilder extends BaseRequestBuilder
*/
protected
function
buildFieldXml
(
$name
,
$boost
,
$value
,
$modifier
=
null
,
$query
=
null
)
{
if
(
$value
instanceof
\DateTime
)
{
$value
=
$query
->
getHelper
()
->
formatDate
(
$value
);
}
$xml
=
'<field name="'
.
$name
.
'"'
;
$xml
.=
$this
->
attrib
(
'boost'
,
$boost
);
$xml
.=
$this
->
attrib
(
'update'
,
$modifier
);
...
...
@@ -242,10 +238,13 @@ class RequestBuilder extends BaseRequestBuilder
$value
=
'false'
;
}
elseif
(
$value
===
true
)
{
$value
=
'true'
;
}
elseif
(
$value
instanceof
\DateTime
)
{
$value
=
$query
->
getHelper
()
->
formatDate
(
$value
);
}
else
{
$value
=
htmlspecialchars
(
$value
,
ENT_NOQUOTES
,
'UTF-8'
);
}
$xml
.=
'>'
.
htmlspecialchars
(
$value
,
ENT_NOQUOTES
,
'UTF-8'
);
$xml
.=
'</field>'
;
$xml
.=
'>'
.
$value
.
'</field>'
;
return
$xml
;
}
...
...
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