Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, so here's what I did to find out whether the problem is in Whoosh or Haystack. I opened the django shell and performed a search for the term that was not showing up in haystack SearchQuery API search:</p> <pre><code>./manage.py shell $&gt;&gt; import whoosh $&gt;&gt; from whoosh.query import * $&gt;&gt; from whoosh.index import open_dir $&gt;&gt; ix = open_dir('/home/somedir/my_project/haystack/whoosh/') $&gt;&gt; ix.schema &lt;Schema: ['branch', 'category', 'coordinator', 'date_event', 'designation','details', 'django_ct', 'django_id'&gt; 'name', 'organisation', 'overview','text', 'title']&gt; $&gt;&gt; searcher = ix.searcher() $&gt;&gt; res = searcher.search(Term('text',u'akshit')) $&gt;&gt; print res &lt;Top 1 Results for Term('text', 'akshit') runtime=0.000741004943848&gt; $&gt;&gt; print res['0']['name'] u'Akshit Khurana' </code></pre> <p>So you see, Whoosh is correctly indexing all data. So, now I try the SearchQuery API</p> <pre><code>./manage.py shell $&gt;&gt; from haystack.query import SearchQuerySet $&gt;&gt; sqs = SearchQuerySet().filter(content='akshit') $&gt;&gt; sqs $&gt;&gt; [] </code></pre> <p>So, I realize that I must check out the whoosh_backend.py file of the haystack library to see what's happening. Open - <code>haystack.backends.whoosh_backend around line number 345</code> </p> <pre><code>'''Uncomment these two lines because the raw_results set becomes empty after the filter call for some queries'' if narrowed_results: raw_results.filter(narrowed_results) </code></pre> <p>to</p> <pre><code>#if narrowed_results: #raw_results.filter(narrowed_results) </code></pre> <p>And then it works. SearchQueryAPI returning exactly one result for the test query as expected. Web search working but I would like to know what's the issue with haystack here. </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