mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
Revert "(fix)(common)fix duplication when adding data to the vector l…" (#1441)
This commit is contained in:
@@ -59,7 +59,6 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
embeddingStore.add(embedding, query);
|
embeddingStore.add(embedding, query);
|
||||||
cache.put(TextSegmentConvert.getQueryId(query), true);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("embeddingModel embed error question: {}, embeddingStore: {}", question,
|
log.error("embeddingModel embed error question: {}, embeddingStore: {}", question,
|
||||||
embeddingStore.getClass().getSimpleName(), e);
|
embeddingStore.getClass().getSimpleName(), e);
|
||||||
@@ -86,6 +85,7 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
EmbeddingSearchResult result = embeddingStore.search(request);
|
EmbeddingSearchResult result = embeddingStore.search(request);
|
||||||
List<EmbeddingMatch<TextSegment>> relevant = result.matches();
|
List<EmbeddingMatch<TextSegment>> relevant = result.matches();
|
||||||
boolean exists = CollectionUtils.isNotEmpty(relevant);
|
boolean exists = CollectionUtils.isNotEmpty(relevant);
|
||||||
|
cache.put(queryId, exists);
|
||||||
return exists;
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +104,8 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
Filter filter = filterBuilder.isIn(queryIds);
|
Filter filter = filterBuilder.isIn(queryIds);
|
||||||
inMemoryEmbeddingStore.removeAll(filter);
|
inMemoryEmbeddingStore.removeAll(filter);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("Not supported yet.");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("deleteQuery error,collectionName:{},queries:{}", collectionName, queries);
|
log.error("deleteQuery error,collectionName:{},queries:{}", collectionName, queries);
|
||||||
|
|||||||
Reference in New Issue
Block a user