|
@@ -371,11 +371,11 @@ export class QdrantEndpoint extends BaseEndpointComponent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Get collections for this shop
|
|
// Get collections for this shop
|
|
|
- let collections: string[] = [];
|
|
|
|
|
|
|
+ let collections: Array<{ name: string; vectors_count: number; config: any }> = [];
|
|
|
if (this.qdrantService && shop.custom_id) {
|
|
if (this.qdrantService && shop.custom_id) {
|
|
|
try {
|
|
try {
|
|
|
const allCollections = await this.qdrantService.listCollections();
|
|
const allCollections = await this.qdrantService.listCollections();
|
|
|
- collections = allCollections.filter(name => name.startsWith(shop.custom_id!));
|
|
|
|
|
|
|
+ collections = allCollections.filter(collection => collection.name.startsWith(shop.custom_id!));
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
logger.error('Failed to list collections:', error);
|
|
logger.error('Failed to list collections:', error);
|
|
|
}
|
|
}
|
|
@@ -385,7 +385,7 @@ export class QdrantEndpoint extends BaseEndpointComponent {
|
|
|
const embeddings = this.db.getShopEmbeddingsStats(shopId);
|
|
const embeddings = this.db.getShopEmbeddingsStats(shopId);
|
|
|
|
|
|
|
|
// Get recent errors
|
|
// Get recent errors
|
|
|
- const errors = this.db.getQdrantErrors(shopId, { limit: 10 });
|
|
|
|
|
|
|
+ const errors = this.db.getQdrantErrors(shopId);
|
|
|
|
|
|
|
|
res.json({
|
|
res.json({
|
|
|
enabled: shop.qdrant_enabled,
|
|
enabled: shop.qdrant_enabled,
|
|
@@ -465,22 +465,12 @@ export class QdrantEndpoint extends BaseEndpointComponent {
|
|
|
const collections = await this.qdrantService.listCollections();
|
|
const collections = await this.qdrantService.listCollections();
|
|
|
const collectionsWithInfo = [];
|
|
const collectionsWithInfo = [];
|
|
|
|
|
|
|
|
- for (const name of collections) {
|
|
|
|
|
- try {
|
|
|
|
|
- const info = await this.qdrantService.getCollectionInfo(name);
|
|
|
|
|
- collectionsWithInfo.push({
|
|
|
|
|
- name,
|
|
|
|
|
- vectors_count: info.vectors_count,
|
|
|
|
|
- config: info.config
|
|
|
|
|
- });
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- logger.error(`Failed to get info for collection ${name}:`, error);
|
|
|
|
|
- collectionsWithInfo.push({
|
|
|
|
|
- name,
|
|
|
|
|
- vectors_count: 0,
|
|
|
|
|
- config: {}
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (const collection of collections) {
|
|
|
|
|
+ collectionsWithInfo.push({
|
|
|
|
|
+ name: collection.name,
|
|
|
|
|
+ vectors_count: collection.vectors_count,
|
|
|
|
|
+ config: collection.config
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
res.json({ collections: collectionsWithInfo });
|
|
res.json({ collections: collectionsWithInfo });
|
|
@@ -557,7 +547,7 @@ export class QdrantEndpoint extends BaseEndpointComponent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Get content to re-embed
|
|
// Get content to re-embed
|
|
|
- const content = this.db.getShopContent(shopId, { contentType: content_type });
|
|
|
|
|
|
|
+ const content = this.db.getShopContent(shopId);
|
|
|
|
|
|
|
|
if (content.length === 0) {
|
|
if (content.length === 0) {
|
|
|
res.status(200).json({ message: 'No content to re-embed' });
|
|
res.status(200).json({ message: 'No content to re-embed' });
|
|
@@ -582,7 +572,7 @@ export class QdrantEndpoint extends BaseEndpointComponent {
|
|
|
const { shopId } = req.params;
|
|
const { shopId } = req.params;
|
|
|
const limit = parseInt(req.query.limit as string) || 50;
|
|
const limit = parseInt(req.query.limit as string) || 50;
|
|
|
|
|
|
|
|
- const errors = this.db.getQdrantErrors(shopId, { limit });
|
|
|
|
|
|
|
+ const errors = this.db.getQdrantErrors(shopId);
|
|
|
|
|
|
|
|
res.json({ errors });
|
|
res.json({ errors });
|
|
|
} catch (error) {
|
|
} catch (error) {
|