Solved

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

Posted on 2010-11-11
4
311 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
  • 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 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
join tables 4 54
mysql joining from the same table 6 42
Exchange 2010 - Best practice MDB Data size 8 82
Documenting Data flow 4 37
This article describes some very basic things about SQL Server filegroups.
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

806 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