Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

mySQL: IN BOOLEAN MODE WITH QUERY EXPANSION

Posted on 2009-04-23
5
Medium Priority
?
642 Views
Last Modified: 2013-12-12
I like using "WITH QUERY EXPANSION" because it does a good job at breading the results.

However I need support for "IN BOOLEAN MODE" because
          food -bank
should remove bank-related results.

When I combine IN BOOLEAN MODE and WITH QUERY EXPANSION I get an error.
select count(`name`) as numrows from `organizations` WHERE ( replace(replace(`name`, ' ', ''),'\'', '') LIKE '%food-bank%' OR replace(`keywords`, ' ', '') LIKE '%food-bank%' OR MATCH (`name`,`keywords`,`description`,`custom_keywords`,`naics_keywords`, `naics_desc`, `p_city`, `promo_text`) AGAINST ('food -bank' IN BOOLEAN MODE WITH QUERY EXPANSION) )

Open in new window

0
Comment
Question by:hankknight
  • 2
  • 2
5 Comments
 
LVL 20

Assisted Solution

by:NerdsOfTech
NerdsOfTech earned 200 total points
ID: 24235417

select count(`name`) as numrows from `organizations` WHERE ( replace(replace(`name`, ' ', ''),'\'', '') LIKE '%food-bank%' OR replace(`keywords`, ' ', '') LIKE '%food-bank%' OR MATCH (`name`,`keywords`,`description`,`custom_keywords`,`naics_keywords`, `naics_desc`, `p_city`, `promo_text`) AGAINST ('food -bank' IN BOOLEAN MODE) )

Open in new window

0
 
LVL 20

Expert Comment

by:NerdsOfTech
ID: 24235419
What is your goal for this?
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 24236510
What is the error?
0
 
LVL 16

Author Comment

by:hankknight
ID: 24278605
This is no such thing as "IN BOOLEAN MODE and WITH QUERY EXPANSION"  but can I accomplish the same thing with a revised query?
0
 
LVL 23

Accepted Solution

by:
Tony McCreath earned 1800 total points
ID: 24278845
I've done searches where I include two MATCH expressions, one of which is using IN BOOLEAN MODE. This way I can combine the boolean features with the better scoring of the standard match.

0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this article, we’ll look at how to deploy ProxySQL.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question