Fix a typo that causes a server error when searching

The wrong variable name is being assigned to the partial local variables and is causing a error when searching.