-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Low search accuracy for people #5722
Comments
Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :). To improve search accuracy for people, follow these steps:
export const FIND_PERSON = gql`
query FindPerson($filter: PersonFilterInput) {
people(filter: $filter, sort: { field: "name", order: ASC }) {
edges {
node {
firstName
lastName
linkedinUrl
label
}
}
}
}
`;
export async function fetchPerson(personFilterData: PersonFilterInput): Promise<Person | null> {
const { data } = await callQuery(FIND_PERSON, { filter: personFilterData });
if (data.people.edges.length > 0) {
return data.people.edges[0].node;
}
return null;
}
export const mockedPeopleData = [
{
firstName: 'Anthony',
lastName: 'May',
linkedinUrl: 'https://linkedin.com/in/anthonymay',
label: 'POC',
},
// other mock data
];
export const Default = Template.bind({});
Default.play = async ({ canvasElement }) => {
const canvas = within(canvasElement);
const searchInput = await canvas.getByPlaceholderText('Search...');
await userEvent.type(searchInput, 'Anthony May');
const result = await canvas.findByText('Anthony May');
expect(result).toBeInTheDocument();
}; References/packages/twenty-front/src/testing/graphqlMocks.ts |
Yes this is a tricky one, not an easy fix See a related comment #3708 (comment) |
Bug Description
Currently, when searching for people in any filter (ex: search for POC in the opportunity page), the search accuracy seems low in some scenarios
Example:
In the screenshots below, I am searching for
Anthony May
how exists in the people list, and the same company as this opportunity, but he doesn't appear on top of the list while being the perfect match to my query(screenshot 1). But if I scroll way down below, I can see the person (screenshot 2)Expected behavior
The search should be accurate and display the best match on top
Example:
In the example above,
Anthony May
should appear on top of the list, followed by the rest with less accuracyTechnical inputs
N/A
The text was updated successfully, but these errors were encountered: