use pregenerated quadindex column from postgres

change  bgdi_id for internal document id