Docker compose volumes configuration clarificationd

In this docker-compose file, I have this snippet:

services:
elasticsearch:

…snip…

volumes:
- elsdata:/usr/share/elasticsearch/data

…snip…

volumes:
elsdata:

Under ‘elasticsearch’ I have volumes specified and I understand the specification of it there. But why at the very end of the file, is there another volumes? What is the purpose of this? Can somebody point me to the documentation where this is explained? Thanks

Full file:

`version: '3.1'`
``
`services:`
`  elasticsearch:`
`    container_name: els`
`    image: docker.elastic.co/elasticsearch/elasticsearch:8.12.2`
`    environment:`
`      - discovery.type=single-node`
`      - xpack.security.enabled=false`
`      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"`
`    ports:`
`      - 9200:9200`
`      - 9300:9300`
`    networks:`
`      - elskibana`
`    volumes:`
`      - elsdata:/usr/share/elasticsearch/data`
``
`  kibana:`
`    container_name: kibana`
`    image: docker.elastic.co/kibana/kibana:8.12.2`
`    environment:`
`      - ELASTICSEARCH_URL=http://elasticsearch:9200`
`    ports:`
`      - 5601:5601`
`    networks:`
`      - elskibana`
`    depends_on:`
`      - elasticsearch`
``
`networks:`
`  elskibana:`
`    driver: bridge`
``
`volumes:`
`  elsdata:`

Sure: