Note that there are some explanatory texts on larger screens.

plurals
  1. POhaystack to solr double requests and char escaping
    text
    copied!<p>Two issues bundled into one question:</p> <p>Why does haystack auto_query send two requests to solr and escapes the : character ?</p> <p>I've set up haystack as it is written in the manual, everything running OK, but whenever I tail my solr log I see two requests if coming from haystack (for one query) and one request if coming from the admin page:</p> <p>So I query:</p> <pre><code>title:ong </code></pre> <p>From Haystack I get:</p> <pre><code>Jul 12, 2012 2:37:30 PM org.apache.solr.core.SolrCore execute INFO: [collection1] webapp=/solr path=/select/ params={spellcheck=true&amp;sort=cand+desc&amp;fl=*+score&amp;start=0&amp;q=(title\:ong)&amp;spellcheck.count=1&amp;spellcheck.collate=true&amp;wt=json&amp;fq=django_ct:(ads.model1+OR+ads.model2+OR+ads.model3)&amp;rows=1} hits=0 status=0 QTime=21 Jul 12, 2012 2:37:30 PM org.apache.solr.core.SolrCore execute INFO: [collection1] webapp=/solr path=/select/ params={spellcheck=true&amp;sort=cand+desc&amp;fl=*+score&amp;start=0&amp;q=(title\:ong)&amp;spellcheck.count=1&amp;spellcheck.collate=true&amp;wt=json&amp;fq=django_ct:(ads.model1+OR+ads.model2+OR+ads.model3)&amp;rows=0} hits=0 status=0 QTime=23 </code></pre> <p>while from the admin section:</p> <pre><code>Jul 12, 2012 2:42:35 PM org.apache.solr.core.SolrCore execute INFO: [collection1] webapp=/solr path=/select params={spellcheck=true&amp;indent=true&amp;q=title:ong&amp;wt=json} hits=2 status=0 QTime=12 </code></pre> <p>Extra parameters exist in haystack requests, that is understandable. </p> <p>As you can see the q parameter is the same. </p> <p>Well almost the same: anyone can tell why haystack auto_query escapes the : character and sends out two requests?</p> <p>I believe that, because : is escaped, Solr doesnt return "ong" just from the field "title" and searches for title\:ong as a string, of course it doesnt return anything.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload