vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Need help with Boolean Search Problems... (https://vborg.vbsupport.ru/showthread.php?t=247424)

Jaxel 07-27-2010 09:18 PM

Need help with Boolean Search Problems...
 
So I am using the following code for my boolean search...

Code:

$results = $vbulletin->db->query_first("
        SELECT media
        FROM " . TABLE_PREFIX . "media
        WHERE MATCH (title, description) AGAINST ('".$keyword."' IN BOOLEAN MODE)
");

There are several issues I am having...

1 - searching for words 3 letters and less return no results. My researching is telling me this is because of a default setting for fulltext searching in mysql that requires a minimum of 4 characters in a search and has to be changed manually... so this is not the real issue...

2 - having trouble finding partial matches for searching. Lets say I have a media with the title "Cassandra VS Cervantes". Searching for "Cassandra" will pull this result up without any issues; however searching for "Cass" or "sandra" will not return this entry in the result. Is there any way to get boolean search to find partial matches?

--------------- Added [DATE]1280272330[/DATE] at [TIME]1280272330[/TIME] ---------------

So I went back to my old search... its not boolean, but I have another issue...

Code:

$results = $vbulletin->db->query_first("
        SELECT media
        FROM " . TABLE_PREFIX . "media
        WHERE description LIKE '%".$keyword."%' OR title LIKE '%".$keyword."%'
");

This works fine (but no boolean), however I am having one issue. Lets say I want to search for "SSF4" and "SC4"... I can't type in "SSF4 SC4" because it will look for the exact phrase of "SSF4 SC4" instead of finding results that contain "SSF4" and/or "SC4". Is there an easy way to fix this? Or do I have to run a preg_match and seperate words by the spaces and duplicate my search terms?


All times are GMT. The time now is 02:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00891 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete