manage ObjectId references in search