Search Handler

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
I have a content type with 3 textfields (title, text1, text2)

How can i insert both texts into the search (and also use them for search)?
PHP:
public function insertIntoIndex($contentType, $contentId, $title, $message, $itemDate, $userId, $discussionId = 0, array $metadata = array())

Should i store text2 into the metadata field? I haven't seen anywhere a example, how to use this exactly.
 
I was wondering the same thing... I considered the metadata field, but looking at those fields for other contenttypes, it seems to be for shorthand information like node IDs, thread IDs, etc...
 
ok it seems that i got it working:)
metadata are useless, but it's possible to add own costraints & joinfields to the data handler.
 
I'm rather curious to hear an explanation for that assertion myself :cautious:
No, they are not useless, i couldn't use them for this "problem"^^

Concatenate text1 and text2 and insert them into the message field.
that's also a nice way(and much easier as mine)
But at least i know now how the search is working, so it was not for nothing^^
 
Hey ragtek,

I think you should put them all in the message field instead of doing expensive join operation. You will also have the benefit of being FULL TEXT searched (and it will still work if someone came up with a different search engine later)
 
Hey ragtek,

I think you should put them all in the message field instead of doing expensive join operation. You will also have the benefit of being FULL TEXT searched (and it will still work if someone came up with a different search engine later)
Joins should be avoided wherever possible, as they prevent non-SQL search engines being employed, hence breaking the plugin system.
 
Top Bottom