Here're steps:
1.Create a list column in the document library.
2.Go to Central administration -> Search service application -> Search Schema -> New Managed Property -> Click Queryable、Searchable、Retrievable, add the crawled property of newly created column as mapping.
3.Start a full crawl.
4.Go to the library -> Edit page -> Add content query web part.
5.Edit content query web part -> In the Source, choose the specific library in the "Show items from the following list" -> In the Additional Filters, select the newly created column set filter.
6.For example, after settings testcolumn is equal to 1, then file1 shows in the content query web part.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.