Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Candy and search - vanillaforums 2.0.18.4

I am experiencing problems with search when Candy Application - latest version (0.34), is running.
When Candy is running an extra field "RecordType"is created. As a result, select queries experience missmatch in the number of columns.

See code listed below - offending lines are indented to the right more than any others. There are 3 of them and read:
'Section' as RecordType' 'Page' asRecordType'
'Chunk' as `RecordType'.

Before I was able to figure this out, the search would report two other issues.
1) The table GDN_Section as shipped with Candy has InnoDB engine type that is not searchable.
2) After adjusting the engine type to MyISAM the search would report absence of FULLTEXT indices in GDN_Sections, GDN_Pages and GDN_Chunk tables.
On adding FULLTEXT indices to three tables, the search now reports the error described here.

Any help with fixing this problem is greatly appreciated.

Tom

select * from ( select match(Name, Body) against(:Search0) asRelavence, d.DiscussionID asPrimaryID, d.Name asTitle, d.Body asSummary, d.Format asFormat, d.CategoryID asCategoryID, concat('/discussion/', d.DiscussionID) asUrl, d.DateInserted asDateInserted, d.InsertUserID asUserIDfrom GDN_Discussion d where match(d.Name, d.Body) against (:Search1) union all select match(c.Body) against(:Search2) asRelavence, c.CommentID asPrimaryID, d.Name asTitle, c.Body asSummary, c.Format asFormat, d.CategoryID asCategoryID, concat('/discussion/comment/', c.CommentID, '/#Comment_', c.CommentID) asUrl, c.DateInserted asDateInserted, c.InsertUserID asUserIDfrom GDN_Comment c join GDN_Discussion d on d.DiscussionID = c.DiscussionID where match(c.Body) against (:Search3) union all select match(s.Name) against(:Search4) asRelavence, s.SectionID asPrimaryID, s.Name asTitle, Null asSummary, "Text" asFormat, Null asCategoryID, coalesce(s.Url, s.URI, s.RequestUri) asUrl, Now() asDateInserted, 0 asUserID, 'Section' asRecordType'
from GDN_Section s where match(s.Name) against (:Search5) union all
select match(Title, Body) against(:Search6) as Relavence,
PageID as PrimaryID,
Title,
Body as Summary,
Format,
Null as CategoryID,
concat('/content/page/', PageID) as Url,
DateInserted,
0 as UserID,
'Page' as RecordType
from GDN_Page Page where match(Title, Body) against (:Search7) union all
select match(Name, Body) against(:Search8) as Relavence,
ChunkID as PrimaryID,
Name as Title,
Body as Summary,
"xHtml" as Format,
Null as CategoryID,
Url,
DateInserted,
0 as UserID,
'Chunk' as RecordType
from GDN_Chunk Chunk where match(Name, Body) against (:Search9)
)
s order by s.DateInserted desc limit 20`

Sign In or Register to comment.