Note that there are some explanatory texts on larger screens.

plurals
  1. POHaystack Not Returning Results that Solr Admin Console Highlights
    text
    copied!<p>I've recently set up solr and haystack to search one of my django models. I attempted to modify the default solr schema built by haystack to use the <code>NGramTokenizerFactory</code>:</p> <pre><code>&lt;fieldType name="text" class="solr.TextField"&gt; &lt;analyzer type="index"&gt; &lt;tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="32" /&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;/analyzer&gt; &lt;analyzer type="query"&gt; &lt;tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="32" /&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;/analyzer&gt; &lt;/fieldType&gt; </code></pre> <p>I have a bunch of one or two word entries in my database which I would like to match against the user's query. So for example, I might have one object with title "dog" and another with title "cat". If the user searches for "dog cat" then I would like to return both the dog and cat objects for that query. </p> <p>Similarly, if I search for "my cool website" I would like the field with "website" to be returned.</p> <p>I tried using the solr admin interface to check to make sure my queries were getting matched. Everything seems okay there: <img src="https://i.stack.imgur.com/VfvJ7.png" alt="enter image description here">: The issue is when I use the haystack default search interface to search for that same query: <img src="https://i.stack.imgur.com/n3hYk.png" alt="enter image description here"></p> <p>As you can see, no results are found. I tried using KeywordFactory and a bunch of different solr configurations. If I'm not mistaken then the query <em>should</em> be getting matched. I'm not sure why haystack is coming up empty though. </p> <p>Thanks for any help / suggestions on if this is the best way to go about such a search.</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