Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mysql match() againts() giving some problems to me?

Posted on 2010-11-11
4
Medium Priority
?
317 Views
Last Modified: 2012-05-10
Hello, I have a litle query that I am using to search inside a database, I have a fulltext index for the fields "titulo & descripcion", and the query works... the problem comes when I put something that doesn't exist in the database (like the search I have in the query "280394829038402938409283403409240240849") this shouldn't give results but the problem is that it keeps giving me results... is there something I am doing wrong?

Thank's

SELECT * , MATCH(titulo, descripcion) AGAINST ('280394829038402938409283403409240240849') as coincidencia from preguntas order by coincidencia DESC
0
Comment
Question by:visionari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 34116472
The match relevance is returned as a positive floating point number, or 0 for no similarity. It must be deciding there is a small similarity somehow! Try this:

SELECT * , MATCH(titulo, descripcion) AGAINST ('280394829038402938409283403409240240849'  IN BOOLEAN MODE) as coincidencia from preguntas order by coincidencia DESC
0
 

Author Comment

by:visionari
ID: 34130439
mmh, not really working for me, all I get is 0 in coincidencia even in keywords that exist...
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1500 total points
ID: 34133892
you have to put that into the WHERE also!
SELECT * , MATCH(titulo, descripcion) AGAINST ('280394829038402938409283403409240240849') as coincidencia 
  FROM preguntas 
 WHERE MATCH(titulo, descripcion) AGAINST ('280394829038402938409283403409240240849') 
ORDER BY coincidencia DESC 

Open in new window

0
 

Author Closing Comment

by:visionari
ID: 34171859
Thank's!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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