title: Solr synonyms with space
body: <p>My data model:</p>
  
  <pre><code>Dress
  |-kind
  |-color
  |-for_season
  </code></pre>
  
  <p>I want to search the model for a specific season as well as for all seasons, like as follows:</p>
  
  <p>Search Query: <code>all seasons</code></p>
  
  <p>Should Match: <code>Winter, Spring, Summer, Fall</code></p>
  
  <p>I have the following line in my synonyms file:</p>
  
  <p><code>all\s seasons: winter, spring, summer, fall</code></p>
  
  <p>I am doing it query time and I see the solr admin panel analyze page showing the synonyms in the term column. However, when I search for <code>for_season:all seasons</code> I don't get any result.</p>
  
  <p>Any idea why? Appreciate your time on this. </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here's what I found:</p>
  
  <ol>
  <li><p>I had to escape the synonyms appearing on the right hand side, as follows:</p>
  
  <pre><code>all news =&gt; weather\ forecast, sports, ...
  </code></pre></li>
  <li><p>At query time, I had to wrap the query in double quotes. as follows:</p>
  
  <pre><code>my_field:"all news"
  </code></pre></li>
  <li><p>I had to put the original word on the RHS as it won't find that unless it was repeated.</p>
  
  <pre><code>news =&gt; news, weather\ forecast, sports, ...
  </code></pre></li>
  </ol>
  
  <p>It looks to be working fine now. Thanks for your time.</p>