> > Let's say I have a dynamic field defined as <dynamicField name="*" > type="string" > > Can I use those fields at query time, although they are not defined in > schema.xml? >
Yes. Though I am not sure whether you can create a dynamic field without a prefix of suffix with the wild-card. I would rather suggest to name this field as "attribute_*" and use fields like attribute_color, attribute_ram etc during indexing and searching. This thread might be useful - http://www.lucidimagination.com/search/document/45897f3dfa3ca260/storing_key_value_pair_in_solr_document Cheers Avlesh On Tue, Aug 11, 2009 at 7:22 PM, AHMET ARSLAN <iori...@yahoo.com> wrote: > I have two parallel multivauled fields for holding key value pairs for each > document. > > <doc> > <arr name="value"> > <str>red</str> > <str>other</str> > <str>VS</str> > <str>10 cm.</str> > <str>50 GB</str> > ... > </arr> > <arr name="key"> > <str>Color</str> > <str>Type</str> > <str>Brand</str> > <str>Size</str> > <str>RAM</str> > .... > </arr> > </doc> > > There ara about 300 different keys. New key values can be created > dynamicly. And some key values are meaningles for some documents. I want to > faceting over these multivalued fields. Something like: > > RAM: > 50 GB (5) > 40 GB (2) > > Brand: > XX (10) > VS (1) > > color: > red (9) > blue (2) > > Is there a way to create this kind of faceting over multi-valued fields? > > And about querying multi-valued fields: > Lets say I want to get blue coloured documents, > The query '+key:color +value:blue' would return those two docs: > > <doc1> > <arr name="value"> > <str>blue</str> > ... > </arr> > <arr name="key"> > <str>color</str> > ... > </arr> > </doc1> > > <doc2> > <arr name="value"> > <str>red</str> > <str>blue</str> > ... > </arr> > <arr name="key"> > <str>color</str> > <str>backcolor</str> > ... > </arr> > </doc2> > > Is there are way to get only doc1 for that kind of query? > Specifying/preserving index/position info for the multivalued fields. > > Let's say I have a dynamic field defined as > <dynamicField name="*" type="string" > > and I add docs with the fields that are elements of those multivalued > fields: > > <add> > <doc> > <field name="color">blue</field> > <field name="brand">vs</field> > </doc> > </add> > > Can I use those fields at query time, although they are not defined in > schema.xml? > > 'q=color:blue' and in faceting 'facet.field=color' > > I'd appreciate any help and pointers. > > > >