A compression program that causes a computer to execute: extracting a specific word from a target file; comparing the extracted word with a bit filter including a plurality of words having higher frequency of appearance and a plurality of compressed codes assigned a code length in accordance with the frequency of appearance corresponding respectively to the plurality of words; storing appearance information of the extracted word in correspondence with a specific record of the specific word in a first storage region (123a, 125a) of an index data (123,125), when the compared word is registered in the bit filter, the appearance information including existence information indicating whether the specific word exists in the target file or appearance information indicating how many times the specific word has appeared in the target file, the first storage region (123a, 125a) of the index data (123, 125) including the plurality of words having higher frequency of appearance; adding a specific record of the specific word to a second storage region (123b, 125b) of the index data (123, 125) and storing appearance information of the extracted word in correspondence with the specific record of the specific word in the second storage region (123b, 125b) of the index data (123, 125), when the specific word is not registered in the bit filter, a compressed code of fixed-length is assigned to the specific word and stored in a dynamic dictionary whose records including the specific word and the compressed code assigned to the specific word are added in a course of compression, the appearance information including existence information indicating whether the specific word appears exists in the target file or appearance information indicating how many times the specific word has appeared in the target file; and outputting the first storage region (123a, 125a) of the index data (123, 125), the compressed code corresponding to the extracted word and the dynamic dictionary to a compressed file. extracting a specific word from a target file; comparing the extracted word with a bit filter including a plurality of words having higher frequency of appearance and a plurality of compressed codes assigned a code length in accordance with the frequency of appearance corresponding respectively to the plurality of words; storing appearance information of the extracted word in correspondence with a specific record of the specific word in a first storage region (123a, 125a) of an index data (123,125), when the compared word is registered in the bit filter, the appearance information including existence information indicating whether the specific word exists in the target file or appearance information indicating how many times the specific word has appeared in the target file, the first storage region (123a, 125a) of the index data (123, 125) including the plurality of words having higher frequency of appearance; adding a specific record of the specific word to a second storage region (123b, 125b) of the index data (123, 125) and storing appearance information of the extracted word in correspondence with the specific record of the specific word in the second storage region (123b, 125b) of the index data (123, 125), when the specific word is not registered in the bit filter, a compressed code of fixed-length is assigned to the specific word and stored in a dynamic dictionary whose records including the specific word and the compressed code assigned to the specific word are added in a course of compression, the appearance information including existence information indicating whether the specific word appears exists in the target file or appearance information indicating how many times the specific word has appeared in the target file; and