How to group by value in certain period?

Hello! Could anyone help me with a query?
I have such a gauge metrics:

# HELP searcher_document_search_words_total  
# TYPE searcher_document_search_words_total gauge
searcher_document_search_words_total{application="application",document="items",} 3.0

This metrics gauge value is always in range from 1 to 50. This value is some kind of unique group.

I want to build a query, that shows a graph or a table with the sum of each group quantity over certain period of time.

Could anyone be so kind to help me with the query?