replacing opensearch with solr
This commit is contained in:
@@ -69,11 +69,11 @@ export default function LibraryContent() {
|
||||
}, []);
|
||||
|
||||
const convertFacetsToTags = (facets?: Record<string, FacetCount[]>): Tag[] => {
|
||||
if (!facets || !facets.tagNames) {
|
||||
if (!facets || !facets.tagNames_facet) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return facets.tagNames.map(facet => {
|
||||
|
||||
return facets.tagNames_facet.map(facet => {
|
||||
// Find the full tag data by name
|
||||
const fullTag = fullTags.find(tag => tag.name.toLowerCase() === facet.value.toLowerCase());
|
||||
|
||||
|
||||
@@ -493,11 +493,11 @@ async function processIndividualMode(
|
||||
|
||||
console.log(`Bulk import completed: ${importedCount} imported, ${skippedCount} skipped, ${errorCount} errors`);
|
||||
|
||||
// Trigger OpenSearch reindex if any stories were imported
|
||||
// Trigger Solr reindex if any stories were imported
|
||||
if (importedCount > 0) {
|
||||
try {
|
||||
console.log('Triggering OpenSearch reindex after bulk import...');
|
||||
const reindexUrl = `http://backend:8080/api/admin/search/opensearch/reindex`;
|
||||
console.log('Triggering Solr reindex after bulk import...');
|
||||
const reindexUrl = `http://backend:8080/api/admin/search/solr/reindex`;
|
||||
const reindexResponse = await fetch(reindexUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -508,12 +508,12 @@ async function processIndividualMode(
|
||||
|
||||
if (reindexResponse.ok) {
|
||||
const reindexResult = await reindexResponse.json();
|
||||
console.log('OpenSearch reindex completed:', reindexResult);
|
||||
console.log('Solr reindex completed:', reindexResult);
|
||||
} else {
|
||||
console.warn('OpenSearch reindex failed:', reindexResponse.status);
|
||||
console.warn('Solr reindex failed:', reindexResponse.status);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Failed to trigger OpenSearch reindex:', error);
|
||||
console.warn('Failed to trigger Solr reindex:', error);
|
||||
// Don't fail the whole request if reindex fails
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user