<div dir="ltr"><div><div><div><div>John<br></div>Thanks for reply. I fixed it. It was a mistake by me in schema file. Wrongly I typed salary as text field but I assumed it is long type. Hence search result was not proper.<br>
<br></div>Thanks again.<br><br></div>BR,<br></div>kamal<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 6:51 PM, John Summerfield <span dir="ltr">&lt;<a href="mailto:summer@js.id.au" target="_blank">summer@js.id.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 22/05/13 09:21, Kamal Palei wrote:<br>
&gt;<br>
&gt; Dear All<br>
&gt; I have indexed a salary field for all individuals. If I search without<br>
&gt; any conditions, I get all the records properly.<br>
&gt;<br>
&gt; Now I need to search with conditions. Need to get records where salary<br>
&gt; is in a particular range.<br>
&gt;<br>
&gt; I am trying a simple code as below.<br>
&gt;<br>
</div>&gt; *$conditions[&#39;fq&#39;][0] = &#39;salary:[2 TO 6]&#39;;<br>
<div class="im">&gt; $results = apachesolr_search_search_execute($keys, $conditions);<br>
&gt; *<br>
&gt; I get almost 90% records correct. But I got few records where salary<br>
&gt; value is 22.<br>
&gt; Clearly 22 is not in the range of 2 to 6. Can somebody point out whats<br>
&gt; the wrong here.<br>
&gt;<br>
&gt; In another case I tried to search as<br>
&gt;<br>
</div>&gt; *$conditions[&#39;fq&#39;][0] = &#39;salary:[2 TO 10]&#39;;<br>
<div class="im">&gt; $results = apachesolr_search_search_execute($keys, $conditions);<br>
&gt; *<br>
&gt; I did not get any record. I wanted to get records where salary is in<br>
</div>&gt; between 2 to *10*. I do not know whats wrong here, mostly the presence<br>
<div class="im">&gt; of 10 is creating problem.<br>
&gt;<br>
&gt; Somebody please help.., or at least point to documentation where I can<br>
&gt; refer and learn.<br>
<br>
</div>If you log SQL statements, you can see the SQL it generates and that<br>
will probably lead you to the solution.<br>
<br>
<br>
I know it&#39;s easy to do this with Postgres, I&#39;ve no idea how easy it is<br>
with the alternatives.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></span></blockquote></div><br></div>