Skip to content

Instantly share code, notes, and snippets.

@kevindoran
Last active December 12, 2015 04:08
Show Gist options
  • Select an option

  • Save kevindoran/4711782 to your computer and use it in GitHub Desktop.

Select an option

Save kevindoran/4711782 to your computer and use it in GitHub Desktop.
Effects of multivalued fields in Solr
<!-- What an auction might look like in its original XML form: -->
<auction>
<title>Desktop PC</title>
<feature>
<name>RAM</name>
<value>16 GB</value>
</feature>
<feature>
<name>CPU Frequency</name>
<value>4.5 GHz</value>
</feature>
</auction>
<!-- What an auction would look like as a Solr document: -->
<doc>
<field name="title">Desktop PC</field>
<field name="feature_name">RAM</field>
<field name="feature_value">16 GB</field>
<field name="feature_name">CPU Frequency</field>
<field name="feature_value">4.5 GHz</field>
</doc>
<!-- The *effect* of multivalued field flattening: -->
<doc>
<field name="title">Desktop PC</field>
<field name="feature_name">RAM CPU Frequency</field>
<field name="feature_value">16 GB 4.5 GHz</field>
</doc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment