Hi,

Why do you need the weight for the tags?

you could index it this way:

{
 id:     123
 tag:    'tag1'
 weight:  0.01
 uniqueKey: combine(id, tag)
}

{
 id:     123
 tag:    'tag2'
 weight:  0.3
 uniqueKey: combine(id, tag)
}

and specify the query-time boost with the help of the weight.
Retrieving the document content in a second request to another solrindex or 
using a db.

there could be a different solution using dynamic fields and index-time boosts 
but I am not sure at the moment. 

Regards,
Peter.

> I want to  know if what i am trying to achieve is doable using solr.
>
> I have some objects that have tags assigned. Tag is as string with weight
> attached,
> so whole document that i want to index can look like that:
> {
>   id: 123,
>   tags: {
>           tag1: 0.01,
>           tag2: 0.3,
>           ...
>           tagN: some_weight
>           }
> }
> Now i want to store list of tags and sort returned results by tag weight.
> The list of tags can be large (up to thousands per document, though mostly
> much less).
> So when i am querying solr for documents containing tag1, it should return
> all documents containing it,
> sorted by weight of this tag. Is there any way to do that?
>   

Reply via email to