Forum Discussion
Daniel8101
Nov 01, 2023Copper Contributor
Error trying to search for a lookup column value
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.
Here's the error I am getting:
- Daniel8101Copper ContributorI 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.