Solr Range Query Does not work in Proper way for some fields
<p>I have added 2 fields <strong>weight_value</strong> &amp; <strong>nofyears_1</strong> in solr documents.</p>

<p>Schema for both fields are as below</p>

<pre><code>&lt;field name="weight_value" type="string" indexed="true" stored="true" /&gt;
&lt;field name="nofyears_1" type="string" indexed="true" stored="true" /&gt;
</code></pre>

<p>Both are stored as <strong>string</strong> as it stores numeric values.</p>

<p>Problem here is Range query works perfectly on <strong>weight_value</strong> field but doesn't work on <strong>nofyears_1</strong> field.</p>

<p>like this</p>

<pre><code>weight_value:[40 TO 50] =&gt; Get all the results only between 40 TO 50
</code></pre>

<p>But</p>

<pre><code>nofyears_1:[1 TO 10] =&gt; Doesn't get results between 1 TO 10, but it fetches the result of 1 &amp; 10 only.
</code></pre>

<p>As well as in,</p>

<pre><code>nofyears_1:[1 TO 5] =&gt; It fetches the result of 1, 5 &amp; 15 only.
</code></pre>

<p>Why my range query doesn't work on this field? </p>

<p>Both the fields are <strong>string</strong>, <strong>No Multiple values</strong></p>