Confusion about index and doc_values

When I test the mapping parameter 'index' and 'doc_values',I found out that when numeric type "index" set "false" and this column can not be aggregated,the result will be 0.
In my opinion,I think 'index' controls the query and 'doc_values' controls the aggregation,but above result really confuse me.

What you understood is correct; index controls query and doc_valuescontrols the aggregation. This is not different for string type of field and numeric type of field. It behaves the same for both. Can you add the mapping and query that you tried which resulted in the confusion.