mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
feat: Qdrant Vector Store search filter (#9900)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -10,12 +10,24 @@ export function getMetadataFiltersValues(
|
||||
ctx: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Record<string, never> | undefined {
|
||||
const metadata = ctx.getNodeParameter('options.metadata.metadataValues', itemIndex, []) as Array<{
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
if (metadata.length > 0) {
|
||||
return metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});
|
||||
const options = ctx.getNodeParameter('options', itemIndex);
|
||||
|
||||
if (options.metadata) {
|
||||
const { metadataValues: metadata } = options.metadata as {
|
||||
metadataValues: Array<{
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
};
|
||||
if (metadata.length > 0) {
|
||||
return metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});
|
||||
}
|
||||
}
|
||||
|
||||
if (options.searchFilterJson) {
|
||||
return ctx.getNodeParameter('options.searchFilterJson', itemIndex, '', {
|
||||
ensureType: 'object',
|
||||
}) as Record<string, never>;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user