user3480455
user3480455

Reputation: 35

SOLR join vs data duplicating

The index contains books, each book has its author, author has country. I need to search books from some country. Is it good to simply store country id in book info, or it's better to store country id only in authors info and do join?

Upvotes: 1

Views: 43

Answers (1)

Jayesh Bhoyar
Jayesh Bhoyar

Reputation: 727

I would suggest you index books,author, country in same index, so your record will look like as:

ID,BOOKNAME,AUTHOR,COUNTRY

1,SOLR,JAYESH,INDIA

2,NUTCH,BHOYAR,INDIA

3,APACHE,USER,US

Now if you search on COUNTRY=INDIA;

it will give you books(SOLR,NUTCH)

Hope this is the answer you were looking for....

Regards,

Jayesh Bhoyar

Upvotes: 2

Related Questions