entity props address for indexing fixed
Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
parent
78b816920d
commit
779d42d9bb
@ -183,49 +183,6 @@ function materio_search_api_get_main_taxonomy_term_5($item){
|
|||||||
// dsm($item, 'item');
|
// dsm($item, 'item');
|
||||||
return materio_search_api_get_onto_term($item, 4);
|
return materio_search_api_get_onto_term($item, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
function company_term_property_country_get_props($term){
|
|
||||||
if( $node = company_get_tode_node($term) ){
|
|
||||||
$field_values = field_get_items('node',$node,'field_public_adress');
|
|
||||||
$address = '';
|
|
||||||
foreach ($field_values as $value) {
|
|
||||||
$address .= $value['value'];
|
|
||||||
}
|
|
||||||
return $address;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function company_get_tode_node($term){
|
|
||||||
if(module_exists('tode'))
|
|
||||||
if( $entitys = tode_get_nids_from_term($term) && isset($entitys['node']) )
|
|
||||||
foreach ($entitys['node'] as $nid => $n)
|
|
||||||
return node_load($nid);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// function materio_search_api_get_taxonomy_terms_after_5($item){
|
|
||||||
// // dsm($item, 'item');
|
|
||||||
// watchdog('materio solr', 'materio_search_api_get_taxonomy_terms_after_5', array());
|
|
||||||
// if(isset($item->field_onthologie['und'])){
|
|
||||||
// $terms = array();
|
|
||||||
// foreach ($item->field_onthologie['und'] as $delta => $value) {
|
|
||||||
// if($delta>4){
|
|
||||||
// $tid = $item->field_onthologie['und'][$delta]['tid'];
|
|
||||||
// $terms[] = taxonomy_term_load($tid);
|
|
||||||
// // $terms[] = $item->field_onthologie['und'][$delta];
|
|
||||||
// // $terms[] = $value['tid'];
|
|
||||||
// watchdog('materio solr', 'tid is '.$tid, array());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return $terms;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
function materio_search_api_get_onto_term($item, $delta){
|
function materio_search_api_get_onto_term($item, $delta){
|
||||||
// dsm($item, 'item');
|
// dsm($item, 'item');
|
||||||
// dsm($delta, 'delta');
|
// dsm($delta, 'delta');
|
||||||
@ -236,6 +193,55 @@ function materio_search_api_get_onto_term($item, $delta){
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function company_term_property_country_get_props($term){
|
||||||
|
// dsm($term, 'company_term_property_country_get_props : term');
|
||||||
|
if( $node = company_get_tode_node($term) ){
|
||||||
|
// $field_values = field_get_items('node',$node,'field_public_address');
|
||||||
|
// dsm($field_values, 'field_values');
|
||||||
|
|
||||||
|
$output = rip_tags(render(field_view_field('node',$node,'field_public_address')));
|
||||||
|
// dsm($output, 'output');
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function company_get_tode_node($term){
|
||||||
|
if(module_exists('tode'))
|
||||||
|
if( $entitys = tode_get_nids_from_term($term))
|
||||||
|
if(isset($entitys['node']))
|
||||||
|
foreach ($entitys['node'] as $nid => $n)
|
||||||
|
return node_load($nid);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function rip_tags($string) {
|
||||||
|
// ----- remove HTML TAGs -----
|
||||||
|
$string = preg_replace ('/<[^>]*>/', ' ', $string);
|
||||||
|
|
||||||
|
// ----- remove control characters -----
|
||||||
|
$string = str_replace("\r", '', $string); // --- replace with empty space
|
||||||
|
$string = str_replace("\n", ' ', $string); // --- replace with space
|
||||||
|
$string = str_replace("\t", ' ', $string); // --- replace with space
|
||||||
|
|
||||||
|
// $string = str_replace(" ", ' ', $string); // --- replace with space
|
||||||
|
// $string = str_replace("'", '\'', $string); // --- replace with space
|
||||||
|
|
||||||
|
// ----- remove multiple spaces -----
|
||||||
|
$string = trim(preg_replace('/ {2,}/', ' ', $string));
|
||||||
|
|
||||||
|
// ----- remove html entities
|
||||||
|
preg_match_all('/&[^;]+;/', $string, $entities);
|
||||||
|
foreach ($entities[0] as $entity) {
|
||||||
|
$string = str_replace($entity, mb_convert_encoding($entity, 'UTF-8', 'HTML-ENTITIES'), $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_block_info().
|
* Implements hook_block_info().
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user