CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Boolean Full-Text Searches

Print topic Send  topic

Author Message
Waspman

Posts: 948
Posted: 09/19/2014, 3:04 AM

It's done in the advanced search function, but it seems you cant just add this to a page.


So I want to do a "contains any of the words in the string" search.


Is there a way to this?




_________________
http://www.waspmedia.co.uk
View profile  Send private message
Waspman

Posts: 948
Posted: 09/19/2014, 3:21 AM

Just found this...

SELECT id, article FROM mytable WHERE MATCH(article) AGAINST ('+word1 +word2' IN BOOLEAN MODE)
does return result, but is very slow.

At the same time, another query
SELECT id, article FROM mytable WHERE MATCH(article) AGAINST ('+word1' IN BOOLEAN MODE) AND MATCH(article) AGAINST ('+word2' IN BOOLEAN MODE)
returns the same result, but could be 100 times faster...


So I'm looking at passing a string slicing it up and building the query.

What do you think?


_________________
http://www.waspmedia.co.uk
View profile  Send private message
Oper


Posts: 1195
Posted: 09/19/2014, 5:23 AM

i will go with the 2nd

and sending the Full SQL during Before Build Select Event
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
Waspman

Posts: 948
Posted: 09/19/2014, 7:37 AM

OK, I've got it working. So the users adds "tags" to a search box and they're passed, sliced and rebuilt into the sql with each of the words an OR option.

Any Ideas how I can make the records that have more of the keywords appear closer to the top of the results?


:)
_________________
http://www.waspmedia.co.uk
View profile  Send private message
Oper


Posts: 1195
Posted: 09/22/2014, 5:25 AM

Big table i will do nothing.

Small Table i will create a Temporary Relevance Counter.

How big are your table?

MySQL or MSSQL?

if MySQL, Version?

INNDODB or MyISAM?
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.