Maybe the documentation is wrong. You need to use an (high) pull-up resistor, not a pull-down one. In the original schematic you used a pull-down. But with my multimeter I saw a voltage of 4.85V on the upside of the resistor. So, is normal to see 1023 on the analog input. High voltage, high input. Also, with this high voltage you need to knock very hard to get a different value, something around 1015, because it is less sensitive. The minimal variation in voltage is shadowed by the presence of an high voltage. And also, the high and low limits of the knock value is from 10 to 100, so this mean you need to use low voltage. To achieve this you need an (high) pull-up resistor.
Connect one side of the 1 Megaohm resistor to 5V. Put the piezo in series with resistor, with the plus sign looking the resistor. Take the analog signal in the middle from the resistor and piezo. Connect the negative side of the piezo to ground. Now, at the analog pin, the multimeter show 5mV and the analog value is 0. When I knock (and not so hard) I can see a momentary voltage (few hundreds millivolts to 1.3V) and analog values ranging from 4/5 to 30.
A credit, and a lot of thanks, to Comme, for the software patch. You need to modify the code for resetting the counter numberOfKnocks or you get a persistent state of "unlocked"..
Hope this help.
Ciao