optimized  (related to space consumption) script for posting search docs