Open amnonkhen opened 1 month ago
PR for this: no test cases added yet.
https://github.com/EBIBioSamples/json-schema-store/pull/57
script to update synthetic field(created just for partial text search by combining few other fields )
db.schemas.updateMany( {}, [ { $set: { searchable: { $trim: { input: { $reduce: { input: [ "$accession", "$description", "$title", "$name", "$group" ], initialValue: "", in: { $concat: [ "$$value", { $cond: [{ $eq: ["$$value", ""] }, "", " "] }, { $ifNull: ["$$this", ""] } ] } } } } } } } ] )
Link on how to add a db migration script that will update those values upon startup. There is a spring feature for it.
@amnonkhen could you please provide a step to reproduce this, I think this has been fixed already and working correctly now.