Well I think I've solved it myself. It seems to be the problem of ID conflicts. The Gems+ mod, Railcraft mod and Forestry mod have crashed each other a lot, so I have to change almost every id of Forestry mod and some in Railcraft and Gems plus. I've tried Torezu's method in scrolling down through NEI menu screen and it does not crash. Next, I've tried to search by typing "onyx" again and it's fine.
In conclusion, I will relate this problem to configuration conflicts. Thank you for helping!