Mysql index error

Hi,
I want to index mysql data with elasticseacrh 2.3.0.
My 'detay' field name is mediumtext in mysql database. I can't index.
I did mapping on sense editor.

PUT ihaleler/ihale/_mapping
{
  "properties": {
    "detay" : {
      "type": "string"
    }  } }

My index.php code:

if($page=='index'){
    
    $db->orderBy('id','asc');
    $ihaleler=$db->get('tbl_ihale');        

    $ihale="SELECT I.*, D.detay, C.cetvel
    FROM admin_ihale.tbl_ihale I
    LEFT JOIN admin_ihale.tbl_ihale_detay D
    ON I.id=D.id
    LEFT JOIN admin_ihale.tbl_ihale_detay_cetvel C
    ON I.id=C.id"; 
    
    foreach($ihaleler as $ihale){
        $id=$ihale['id'];
        if($id>0){
            $params=array();
            $dizi=array();            
            $dizi['id']=$id*1;
            $dizi['detay']=$ihale['detay'];

            $params['body']=$dizi;
            $params['index']=$index_name;
            $params['type']=$type_name;
            $params['id']=$id;
            
            $ret=$client->index($params);

My error:

Notice: Undefined index: detay in /home/admin/web/localhost/public_html/proje_ihale/indexleme.php on line 83

I don't know PHP, but the error seems to indicate that you are trying to pass the detay field in as an actual index.