Commit cb45f8b7 authored by Bas de Nooijer's avatar Bas de Nooijer

Added 'match' result for analysis and updated the examples

parent 64c94018
...@@ -62,6 +62,7 @@ foreach ($result as $document) { ...@@ -62,6 +62,7 @@ foreach ($result as $document) {
echo 'Position: ' . $result->getPosition() . '<br/>'; echo 'Position: ' . $result->getPosition() . '<br/>';
echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>'; echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>'; echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
echo '-----------<br/>'; echo '-----------<br/>';
} }
} }
...@@ -82,6 +83,7 @@ foreach ($result as $document) { ...@@ -82,6 +83,7 @@ foreach ($result as $document) {
echo 'Position: ' . $result->getPosition() . '<br/>'; echo 'Position: ' . $result->getPosition() . '<br/>';
echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>'; echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>'; echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
echo '-----------<br/>'; echo '-----------<br/>';
} }
} }
......
...@@ -42,6 +42,7 @@ foreach ($results as $result) { ...@@ -42,6 +42,7 @@ foreach ($results as $result) {
echo 'Position: ' . $result->getPosition() . '<br/>'; echo 'Position: ' . $result->getPosition() . '<br/>';
echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>'; echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>'; echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
echo '-----------<br/>'; echo '-----------<br/>';
} }
} }
...@@ -62,6 +63,7 @@ foreach ($results as $result) { ...@@ -62,6 +63,7 @@ foreach ($results as $result) {
echo 'Position: ' . $result->getPosition() . '<br/>'; echo 'Position: ' . $result->getPosition() . '<br/>';
echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>'; echo 'Position history: ' . implode(', ',$result->getPositionHistory()) . '<br/>';
echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>'; echo 'Type: ' . htmlspecialchars($result->getType()) . '<br/>';
echo 'Match: ' . var_export($result->getMatch(),true) . '<br/>';
echo '-----------<br/>'; echo '-----------<br/>';
} }
} }
......
...@@ -80,6 +80,10 @@ class Solarium_Result_Analysis_Item ...@@ -80,6 +80,10 @@ class Solarium_Result_Analysis_Item
*/ */
protected $_type; protected $_type;
/**
* @var boolean
*/
protected $_match = false;
/** /**
* Constructor * Constructor
...@@ -98,6 +102,10 @@ class Solarium_Result_Analysis_Item ...@@ -98,6 +102,10 @@ class Solarium_Result_Analysis_Item
if (isset($analysis['raw_text'])) { if (isset($analysis['raw_text'])) {
$this->_rawText = $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 ...@@ -154,7 +162,7 @@ class Solarium_Result_Analysis_Item
/** /**
* Get position history value * Get position history value
* *
* @return array * @return array
*/ */
public function getPositionHistory() public function getPositionHistory()
...@@ -172,4 +180,14 @@ class Solarium_Result_Analysis_Item ...@@ -172,4 +180,14 @@ class Solarium_Result_Analysis_Item
return $this->_type; return $this->_type;
} }
/**
* Get match value
*
* @return boolean
*/
public function getMatch()
{
return $this->_match;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment