Not directly. The various workarounds depend on how you intend to access and query the values. What are your use cases?

-- Jack Krupansky

-----Original Message----- From: Silvia Suárez
Sent: Tuesday, April 1, 2014 12:29 PM
To: solr-user@lucene.apache.org
Subject: How to add a map of key/value pairs into a solr schema?

Dear all,

I'm trying to add a map of key/value pairs into the solr schema, and I just
wordering if it is possible.

For instance:

This is my schema.xml :

<field name="c_noticia" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
<field name="c_tipo" type="int" indexed="true" stored="true"
multiValued="false"/>
<field name="c_perfil" type="int" indexed="true" stored="true"
multiValued="true"/>
<field name="tipo_red" type="int" indexed="true" stored="true"
multiValued="false"/>
<field name="descriptores" type="map?" indexed="true" stored="true"
multiValued="true" />


Is it possible to define a type= map (see the example above in the schema)
into the solr xchema?, for example something like this:

map: 2252 / 23
        3789 / 12
        3790 / 21
        3794 / 19

And get a result like this:

<doc>
   <str name="c_noticia">62906367</str>
   <arr name="c_perfil">
     <int>2252</int>
     <int>3789</int>
     <int>3790</int>
     <int>3794</int>
   </arr>
     :
     :
     <map? name="descriptores">
     <?>2252 / 23</?>
     <?>3789 / 54</?>
     <?>3790 / 21</?>
     <?>3794 / 12</?>
   </map?>
</doc>

I mean, is it possible introduce a map into one document?

Thanks in advance for some help,

Silvia.

Reply via email to