You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Rakhi Khatwani <rk...@gmail.com> on 2009/11/08 05:37:38 UTC
Representing a complex schema in solr
Hi,
i have a complex schema as shown below:
Book
- Title
- Category
- Publication
- Edition
- Publish Date
- Author (multivalued) => Author is a multivalued field containing
the following attributes.
- Name
- Age
- Location
- Gender
- Qualification
i wanna store the above information in solr so that i can query in every
aspect
one small query example would be:
1. search for all the books written by females.
2. search for all books writen by young authors...for example between the
age 22 to 30.
i woudn't wanna use RDBMS coz i have more than one million documents like
this.
i also tried saving the author as a JSON string. but then i cannot use wild
card and range queries on it.
any suggessions how wud i represent something like this in solr??
Regards,
Raakhi
Re: Representing a complex schema in solr
Posted by Israel Ekpo <is...@gmail.com>.
On Sat, Nov 7, 2009 at 11:37 PM, Rakhi Khatwani <rk...@gmail.com> wrote:
> Hi,
>
> i have a complex schema as shown below:
>
> Book
> - Title
> - Category
> - Publication
> - Edition
> - Publish Date
> - Author (multivalued) => Author is a multivalued field containing
> the following attributes.
> - Name
> - Age
> - Location
> - Gender
> - Qualification
>
>
> i wanna store the above information in solr so that i can query in every
> aspect
>
> one small query example would be:
> 1. search for all the books written by females.
> 2. search for all books writen by young authors...for example between the
> age 22 to 30.
>
> i woudn't wanna use RDBMS coz i have more than one million documents like
> this.
>
> i also tried saving the author as a JSON string. but then i cannot use wild
> card and range queries on it.
>
> any suggessions how wud i represent something like this in solr??
>
> Regards,
> Raakhi
>
Hi Rakhi,
I think you should do this to simplify your storage and retrieval process:
Instead of having one multi-valued "author" field, store each attribute as a
separate multi-valued field.
So name, age, location, gender and qualification will be separate fields in
the schema.
This will allow you to query the way you are asking
q=gender:female
OR by age
q=age:[22 TO 30]
Use tint (solr.TrieIntField) for the age field (if you are using Solr 1.4)
--
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.