On Sat, Oct 09, 2010 at 06:31:19PM -0400, Erick Erickson said:
> I'm confused. What do you mean that a user can "set any
> number of arbitrarily named fields on a document". It sounds
> like you are talking about a user adding arbitrarily may entries
> to a multi-valued field? Or is it some kind of key:value pairs
> in a field in your schema?

Users can add arbitary key/values to documents. Kind of like Machine 
Tags.

So whilst a document has some standard fields (e.g title="My Random 
Document", user="Simon", date="2010-10-11") I might have added 
current_temp_in_c="32" to one of my documents but you might have put 
time_taken_to_write_in_mins="30".

We currently don't index these fields but we'd like to and be able to 
have users sort on them. 

Ideas I had:

- Everytime a user adds a new field (e.g time_taken_to_write_in_mins) 
update the global schema

But that would be horrible and would create an index with many thousands 
of fields.

- Give each user their own core and update each individual schema

Better but still inelegant

The multi valued field idea occurred to me because I could have, for 
example

user_field: [time_taken_to_write_in_mins=30, current_temp_in_c=32]

(i.e flatten the key/value)

I could then maybe write something that allowed sorting only on matched 
values of multi-value field. 

        sort=user_field:time_taken_to_write_in_mins=*

or

        fq=user_field:time_taken_to_write_in_mins=*&sort=user_field

It was just an idea though and I was hoping that there would be a 
simpler more orthodox way of doing it.

thanks,

Simon

Reply via email to