In his journal, prosecutors said, he referred to Hitler and “Nazi culture.” On his phone, he searched online at least four times for “why did Hitler hate the Jews” and looked for “prominent companies founded by Jews in America.”

Those details emerged as federal prosecutors filed hate crime charges on Monday against the man accused of stabbing five Jewish people at a Hanukkah celebration over the weekend in the New York suburbs.

In recent weeks, the criminal complaint said, the man, Grafton E. Thomas, had also searched for “German Jewish Temples near me,” and “Zionist Temples” in Elizabeth, N.J., and in Staten Island.

The attack on Saturday at the home of a rabbi, coming after a slew of recent anti-Semitic incidents, has rattled the region’s Jewish population. The authorities have boosted police patrols in ultra-Orthodox neighborhoods and bolstered security at area synagogues and yeshivas.