The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#361
|
|||
|
|||
Implementing Sphinx full-text search engine
Based on Sphinx 0.7.9 and vB 3.6.7 PL1. This means all file edits and config files are only tested with those two versions, it doesn't mean you cannot make Sphinx work with your vB 3.5 installation but it will require manual work on your side. Known limitations
|
#362
|
|||
|
|||
Can somebody give this a look, I tried to list some limitations/bugs/contributions that we are currently experiencing. Did I miss anything important?
|
#363
|
|||
|
|||
Orban,
Very nicely put together. I still have my older working Sphinx setup working (thanks to you and many others in here) so I have no need to change anything just yet, but thanks for the wonderful write-up! |
#364
|
|||
|
|||
Quote:
1. you did CREATE TABLE sph_counter but used sphinx_counter in sphinx.conf. 2. Then it would be great to have PREFIX_ where you would place your personal Vb table prefix. I added them there but it is not an easy task for those who do not know mysql syntax. 3. A step by step how to implement sort_search_items() would be nice. Thanks for EXCELLENT work! EDIT: Couple of things I would still like to know: when you have Sphinx search in place, do you need to have FULLTEXT index(es) in Vbulletin at all? Also, is Sphinx used in "new posts" seach, too? |
#365
|
||||
|
||||
orban, I don't see any reference in vBulletin or Sphinx to 'timesegments':
Code:
elseif ($vbulletin->GPC['sortby'] == 'timesegments') $cl->SetSortMode ( SPH_SORT_TIME_SEGMENTS); Also, if anyone got kmike's trick (for username is userid_12345) fixed into their configuration files, could you be kind and post here the actual code? Thanks for taking the time to write this up. |
#366
|
|||
|
|||
Another question: is there a way to check if searchd is running and if not, put text "search is offline" to the search page?
|
#367
|
||||
|
||||
Very easy.
PHP Code:
Now, back to my question. Can anyone help me with the username setup? I can't think how you can use a variable in Sphinx conf file... because you cannot. Obviously I`m wrong, kmike did it but unfortunatelly he is not available. |
#368
|
|||
|
|||
<a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat" target="_blank">http://dev.mysql.com/doc/refman/5.0/...unction_concat</a>
The query that grabs the posts, use two concats: CONCAT( post, ' ', CONCAT( 'userid_', userid ) ) untested, but I hope you get the idea. Then you need to modify search.php to transform a given userid into the string... |
#369
|
||||
|
||||
Aha, thanks orban. What I want to do is this:
If an user wants to search for all threads/posts related to a specific user, he enters a username then leaves the search field empty. The results will show all threads started by that user, ordered the way you like it in Sphinx. Anyone wants to work with me on this project? I PM'ed kmike, hoping he will join us... since he is the only one who managed to fix this, not to mention other little extras. Quote:
Code:
/*** * Removes duplicate keys and orders thread id's by lastpost * * @param array record id's to be ordered * * @return array */ function sort_thread_ids($keys) { global $vbulletin; $itemids = array(); $items = $vbulletin->db->query_read_slave(" SELECT threadid FROM " . TABLE_PREFIX . "thread AS thread WHERE threadid IN (" . implode(',', array_keys($keys)) . ") ORDER BY lastpost " . $vbulletin->GPC['sortorder'] . " "); while ($item = $vbulletin->db->fetch_array($items)) { $itemids[] = $item['threadid']; } unset($item); $vbulletin->db->free_result($items); return $itemids; } Code:
if (!$vbulletin->GPC['showposts'] AND $vbulletin->GPC['sortby'] == 'lastpost') { $orderedids = sort_thread_ids($orderedids); } The function above has less processing code then the original sort_search_items() function. The PHP BBCode at vb.org is screwed, it breaks the code lines. Switched back to Code, much better. |
#370
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|