1. A sorting method of data documents, adapted to an electronic device comprising a processor, and the sorting method comprises: retrieving, by the processor, a plurality of keywords from contents of a plurality of data documents; retrieving, by the processor, keyword rankings corresponding to the plurality of keywords by a search engine, wherein the keyword rankings are ranking information of a plurality of keyword ranking data searched by the search engine corresponding to the plurality of keywords in a predetermined duration; searching, by the processor, keyword categories corresponding to the plurality of keywords; and generating, by the processor, a sort algorithm based on the plurality of keywords, the keyword ranking and the keyword category of each of the plurality of keywords, and a current ranking of each of the plurality of data documents, wherein the sort algorithm is used to calculate a predicting ranking of another data document and to sort the another data document, wherein generating the sort algorithm, further comprising: generating, by the processor, the sort algorithm by setting the keyword ranking and the keyword category of each of the plurality of keywords as an input of the sort algorithm and setting the current ranking of each of the plurality of data documents as an output of the sort algorithm.