Reputation: 599
i have an index of products in solr (the index is updated with DataImport from a mysql/jdbc).
the products can be available or not in some store: right now we have this model in the index (the stores are a multivalued int field)
{
id:
product_id:
stores: [ store_id, store_id, ...]
...
}
the stores
field in gonna be changed very often, with an external tool that updates the solr document, changing only the value in the array.
is this the best pattern to model this in solr? could be better to have separate documents and then join?
Upvotes: 1
Views: 149
Reputation: 15789
depends on what is very often for you, it might be ok to just update the whole doc...But, if it is going to be a problem and you wish to optimize the load due to the constant updating, you have several options:
I would prefer 1 myself, more integrated with the rest of Solr than 2...3 and 4 are not a good fit imho.
Upvotes: 2