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
cb45f8b7
Commit
cb45f8b7
authored
Oct 21, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'match' result for analysis and updated the examples
parent
64c94018
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
examples/2.4.1-analysis-document.php
examples/2.4.1-analysis-document.php
+2
-0
examples/2.4.2-analysis-field.php
examples/2.4.2-analysis-field.php
+2
-0
library/Solarium/Result/Analysis/Item.php
library/Solarium/Result/Analysis/Item.php
+19
-1
No files found.
examples/2.4.1-analysis-document.php
View file @
cb45f8b7
...
...
@@ -62,6 +62,7 @@ foreach ($result as $document) {
echo
'Position: '
.
$result
->
getPosition
()
.
'<br/>'
;
echo
'Position history: '
.
implode
(
', '
,
$result
->
getPositionHistory
())
.
'<br/>'
;
echo
'Type: '
.
htmlspecialchars
(
$result
->
getType
())
.
'<br/>'
;
echo
'Match: '
.
var_export
(
$result
->
getMatch
(),
true
)
.
'<br/>'
;
echo
'-----------<br/>'
;
}
}
...
...
@@ -82,6 +83,7 @@ foreach ($result as $document) {
echo
'Position: '
.
$result
->
getPosition
()
.
'<br/>'
;
echo
'Position history: '
.
implode
(
', '
,
$result
->
getPositionHistory
())
.
'<br/>'
;
echo
'Type: '
.
htmlspecialchars
(
$result
->
getType
())
.
'<br/>'
;
echo
'Match: '
.
var_export
(
$result
->
getMatch
(),
true
)
.
'<br/>'
;
echo
'-----------<br/>'
;
}
}
...
...
examples/2.4.2-analysis-field.php
View file @
cb45f8b7
...
...
@@ -42,6 +42,7 @@ foreach ($results as $result) {
echo
'Position: '
.
$result
->
getPosition
()
.
'<br/>'
;
echo
'Position history: '
.
implode
(
', '
,
$result
->
getPositionHistory
())
.
'<br/>'
;
echo
'Type: '
.
htmlspecialchars
(
$result
->
getType
())
.
'<br/>'
;
echo
'Match: '
.
var_export
(
$result
->
getMatch
(),
true
)
.
'<br/>'
;
echo
'-----------<br/>'
;
}
}
...
...
@@ -62,6 +63,7 @@ foreach ($results as $result) {
echo
'Position: '
.
$result
->
getPosition
()
.
'<br/>'
;
echo
'Position history: '
.
implode
(
', '
,
$result
->
getPositionHistory
())
.
'<br/>'
;
echo
'Type: '
.
htmlspecialchars
(
$result
->
getType
())
.
'<br/>'
;
echo
'Match: '
.
var_export
(
$result
->
getMatch
(),
true
)
.
'<br/>'
;
echo
'-----------<br/>'
;
}
}
...
...
library/Solarium/Result/Analysis/Item.php
View file @
cb45f8b7
...
...
@@ -80,6 +80,10 @@ class Solarium_Result_Analysis_Item
*/
protected
$_type
;
/**
* @var boolean
*/
protected
$_match
=
false
;
/**
* Constructor
...
...
@@ -98,6 +102,10 @@ class Solarium_Result_Analysis_Item
if
(
isset
(
$analysis
[
'raw_text'
]))
{
$this
->
_rawText
=
$analysis
[
'raw_text'
];
}
if
(
isset
(
$analysis
[
'match'
]))
{
$this
->
_match
=
$analysis
[
'match'
];
}
}
/**
...
...
@@ -154,7 +162,7 @@ class Solarium_Result_Analysis_Item
/**
* Get position history value
*
*
* @return array
*/
public
function
getPositionHistory
()
...
...
@@ -172,4 +180,14 @@ class Solarium_Result_Analysis_Item
return
$this
->
_type
;
}
/**
* Get match value
*
* @return boolean
*/
public
function
getMatch
()
{
return
$this
->
_match
;
}
}
\ 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