简体   繁体   中英

how to store in SOLR (mini) relational data

My data set is title, description and tags.
I would like to store and index in the SOLR the tag_name and their relative tag_id.
As can be understood, each record has one title, one description bt many tag names + tag ids.

I guess I can store the tags as "some-tag-[id]" but his seems wrong.

You can index tags and tags_id as multivalued fields and add in order.
The order is maintained so you can map them within the fields.

<field name="tags" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="tags_id" type="string" indexed="false" stored="true" multiValued="true"/>

Response -

<arr name="tags">
    <str>tag1</str>
    <str>tag2</str>
    <str>tag3</str>
</arr>
<arr name="tags_id">
    <str>id1</str>
    <str>id2</str>
    <str>id3</str>
</arr>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM