'If matched job title return name elasticearch python client

I have about 50k docs in an elastic search index. I have a query that return all jobs in the index. I would like to return the all names if job is matched in index. I have a field called full_name.

I would like to return all names_names in the index by default I think elasticsearch returns 10 docs.

So if the job is doctor and there are 20k doctors I should get all names of the doctors.

I have tried.

search_param = {
    'query': {
        'match': {
            'job': 'doctor'
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source