title: Indexing multivalue with Solr, choose type=text or string
body: <p>I've read an example spring-solr and I have a question as following:</p>
  
  <p>In a Product entity, there are many categories and I want to index and query them </p>
  
  <p>In schema I have configurations:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;field name="categories" type="text_ws" multivalue="true"&gt; (text_ws with a simple tokenizer: WhitespaceTokenizerFactory) (1)
  or
  &lt;field name="categories" type="string" multivalue="true"&gt; (2)</code></pre>
  </div>
  </div>
  </p>
  
  <p>When that with the way (1) I will push to Solr with a full string which contains the categories separated by space letter to make indexing as well as for querying and with the way (2) that is a list of strings with each string is one category.</p>
  
  <p>I would like to know the way is better than for indexing and for querying. 
  In entity representations then I prefer (2) more than (1) that is a list of strings</p>