Exemple #1
0
def matchResumes(keywords,
                 experience,
                 location,
                 max_salary,
                 last_time,
                 fields='',
                 start=0,
                 rows=500):
    q = getMatchResumeQuery(keywords, experience, location, max_salary,
                            last_time)
    print q
    s = SearchClient()
    response = s.search(q,
                        fields,
                        CLUSTER_ID,
                        'id',
                        'desc',
                        start=start,
                        rows=rows)
    int_fields = ['experience', 'min_salary', 'rating']
    date_fields = []
    for res in response.results:
        for fld in res.keys():
            if fld in int_fields: res[fld] = unformat.Int(res[fld])
            elif fld in date_fields: res[fld] = unformat.Date(res[fld])

    return response
Exemple #2
0
def matchResumes(keywords, experience, location, max_salary, last_time, fields='', start=0, rows=500):
    q = getMatchResumeQuery(keywords, experience, location, max_salary, last_time)
    print q
    s = SearchClient()
    response = s.search(q, fields, CLUSTER_ID, 'id', 'desc', start=start, rows=rows)
    int_fields = ['experience', 'min_salary', 'rating']
    date_fields = []
    for res in response.results:
        for fld in res.keys():
            if fld in int_fields:   res[fld] = unformat.Int(res[fld])
            elif fld in date_fields:   res[fld] = unformat.Date(res[fld])
            
    return response
    def testSearch(self):
        s = SearchClient()
        results = s.search('skills:c*', '', 'solr_test')

        for result in results:
            print result