开发者

storing n+1 objects in a solr document

I'm struggling to work out how the best way to store n+1 object in a solr document.

I am storing a CV/resume document in a solr document. I am looking at storing two different data types "education" and "employment"

If we look at education the object looks like this:

{
 "establishment" =&g开发者_如何学Ct; 'Oxford',
 "Subject" => 'Computing',
 "Type" => 'Degree',
 "Grade" => '2:1'
}

A CV can have n+1 of these objects depending on the contents of the CV. The search needs to be able to see that when I search for CV with Establishment = Oxford & Subject = Computing & Grade = 2:1 that it matches this object not a different establishment with the same subject and grade.

A multivalue I don't think would help or is possible to store n+1 of these types of objects.

My question is how to set up solr to be able to store this type of data against one "CV" Solr document so that it is search able as part of a general search of the index?


You essentially want to turn Solr into a relational database. I.e. you want to enforce some structure on your documents rather than having them just be a bag of words.

If you need relations, then you need relations. The only way I can think of accomplishing this is to index education objects separately, and then have a "foreign key" from the resume.

Alternatively, it seems likely that your "n" will be pretty small. So you could just include each resume in the index multiple times, once with each education listing. This might throw off scoring a bit, but ymmv.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜