Show
Ignore:
Timestamp:
03/29/06 09:50:44 (6 years ago)
Author:
knok
Message:

Added default fields "score", "date" and "rank" in ResultXS.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Search-Namazu/trunk/Search-Namazu/Namazu.xs

    r246 r247  
    5656 
    5757#define SEARCH_NAMAZU_FIELDS 5 
     58#define SCORE "score" 
     59#define SCORE_LEN strlen(SCORE) 
     60#define DATE "date" 
     61#define DATE_LEN strlen(DATE) 
     62#define RANK "rank" 
     63#define RANK_LEN strlen(RANK) 
    5864 
    5965static int status = 0; 
     
    136142                        HV *hash; 
    137143                        SV *ref; 
     144                        SV *score, *date, *rank; 
    138145                        int j; 
    139146                        char fcont[BUFSIZE]; 
     
    147154                                        newSVpv(fcont, strlen(fcont)), 0); 
    148155                        } 
     156                        score = newSViv(hlist.data[i].score); 
     157                        date = newSViv(hlist.data[i].date); 
     158                        rank = newSViv(hlist.data[i].rank); 
     159                        hv_store(hash, SCORE, SCORE_LEN, score, 0); 
     160                        hv_store(hash, DATE, DATE_LEN, date, 0); 
     161                        hv_store(hash, RANK, RANK_LEN, rank, 0); 
    149162 
    150163                        ref = newRV_inc((SV*) hash);