Error trying to search for a lookup column value

Copper Contributor

I am currently working on setting up a My Search webpart in Sharepoint on premise, but I keep getting an unknown error.

 

The lookup column I am trying to search was named "name" on the first list it was added to, and named "DepartmentId" on the list that I am trying to pull from. Do columns have to be named the same for the search results to display properly?

 

Here's the query template I am using:

{searchTerms}
path:http://website/Lists/Employees/

DepartmentId:*

 

The strange part is that I added the column "DepartmentId" to the Manage Columns section of the webpart and the department column will populate when I don't try filtering for it on the query template, but will cause the error when I add to the query template.

Daniel8101_1-1698874334752.png

Daniel8101_2-1698874595212.png

 

 

 

Here's the error I am getting:

Daniel8101_0-1698874218070.png

 

1 Reply
I figured this one out! The column I was trying to search for was not marked as "Searchable". So we mapped it to a "Searchable" column, re-indexed the site, and got the issue resolved.