include_once("credential.php");
function delete_field($query,$del){/*
date_default_timezone_set("Asia/Calcutta");
require_once('../SolrPhpClient/Apache/Solr/Service.php');
//$solr2 = new Apache_Solr_Service($credential_arr['ip'],$credential_arr['port'],'/estbl_list_add/estbl_list_add');
$solr2 = new Apache_Solr_Service("172.18.8.153","2001",'/estbl_list_add/estbl_list_add');
//echo "m in function";exit;
$pairss = explode(',',$del);
$str_arr1 = array("name","subcats","categories","features","metroName","cityName","keywords","tags");
$compulsory_str_field_arr = array("id","subcatIds","categoryIds","price","cuisineCount","completionMeter","neighborhoodIds","metroId","cityId",
"zoneId","chainId","containerId","entityId","rating","reviewCount","awardsCatId","awardRating","awardReviewCount",
"newRating","newReviewCount","status","bClubOrder","name","subcats","categories","categoriesSeoName","features",
"attributes","neighbourhood","parentNeighbourhood","neighborhoodNames","landmark","street1","street2","street3",
"dialingCode","metroName","cityName","zoneName","estPhone","operationHours","estDid","suggestionIds",
"suggestions","logo","photos","menus","showCasedPhotos","reviewsEnabled","keywords","tags","tableBookingUrl",
"homeDeliveryUrl","containerName","overview","knownFor","url","burrpCertified","hasBOffers","bOfferDetails",
"bOfferImgPath","bExperience","isOwned","tweets","weightedRating","weightedAwardRating","latitude","longitude",
"weightedNewRating","estRank","nwListingId","dateOfOpening","didContractStartDate","didContractEndDate");
//print_r($compulsory_str_field_arr);exit;
//print_r($pairss);exit;
foreach($pairss as $k)
{
if(in_array($k,$compulsory_str_field_arr))
{
echo " can not delete ".$k."
";
$flg = 1;
}
}
if($flg==1)
{
exit;
}
foreach($str_arr1 as $k){
if(in_array($k,$pairss))
{
$new_name = "s".$k;
array_push($pairss,$new_name);
}
}
//print_r($pairss);//exit;
if($solr2->ping()){ //print_r($pairss);exit;
$result = $solr2->search($query);
if($result->response->numFound > 0){
$document = new Apache_Solr_Document();
$flag = 0;
foreach($result->response->docs as $doc){//echo "m here 1
";
foreach($doc as $key => $value){//echo "m here 2
";
if(!in_array($key,$pairss)){
//echo "if m here ".$key."
" ;
$document->$key = $value;
$flag = 1;
}else{
//echo "else m here ".$key."
" ;
}
}
//print_r($document);//exit;
if($flag ==1){
$solr2->addDocument($document);
$solr2->commit();
}
}
}
unset($solr2);
}else{
echo "Solr Servers are not responding!";
}
*/}
?>