Closed (duplicate)
Project:
Apache Solr Search
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2010 at 15:37 UTC
Updated:
14 Feb 2011 at 00:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
cpliakas commentedThe attached patch initializes the variable, which fixes the issue.
Comment #2
kaareThe reason it's undefined is because the test using it is just wrong. It's testing whether the previous result document is empty, which (usually) it never is, as theme('apachesolr_search_snippet') at least returns
' ...'. A more correct test is the one attached. I assume the test in line 552 is whether we have an available snippet yet for this document.This has become a major issue for me right now as a lot of my content types return empty snippets when using faceted search and no terms are given.
This patch works for me, btw. My snippets are back ;-)
Comment #3
dawansv commentedYes I have the same problem with no snippets showing except for the first item in the list when doing a facet search without keyword. That's because the test on $snippet carries the snippet from the previous doc, and so it never gets set for the next documents!
Patch in #2 solves the problem. Thanks.
It's surprising there is not more "chatter" around this issue as this render non-keyword searches inoperative.
Comment #4
pwolanin commentedwhy === 0 instead of e.g. empty(), or even just implicit cast to boolean?
Comment #5
kaareNo good reason.
if (! $snippets)is better, I agree.Comment #6
soyarma commentedso with that in mind, is the attached patch to everyone's liking?
Comment #7
jpmckinney commentedDuplicate #901720: Highlighting snippets in search results not flexible enough, and logic improvement.. I'll commit it there.