Send searchClient by reference instead of by value that causes segmentation fault