Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di bANART
    Registrato dal
    Jul 2005
    Messaggi
    662

    ricerca FULLTEXT funziona solo se i record in db sono > 2

    Ma che cosa strana è questa...
    Ho cancellato tutti i record di un db per "pulirlo" e ricominciare, ho iscritto due persone fittizie, ed ora la ricerca con fulltext del motore di ricerca interno non funziona più.

    Le ho provate tutte:
    - cancellare un record alla volta per vedere qual'era che faceva casino e niente.
    - ho provato a lasciare gli ultimi 2 + uno vecchio -> funziona
    - ho provato a lasciare solo 2 record vecchi -> non funziona
    - ho provato a lasciare 3 record a caso -> funziona

    Funziona solo se ci sono almeno 3 record!

    Se è per questo non dovrebbe darmi grandi problemi, credo che di utenti ne raggiungerò sicuramente più di due, ma vorrei sapere perchè mi fa sto scherzo!

    Secondo voi, a naso, cosa potrebbe essere?
    (se avete bisogno di farmi fare prove su db o codice dite pure!)
    Grazie
    Matteo Coletta - fotografia
    Fotografo Lanciano - Fotografia a Lanciano e Pescara

  2. #2
    Such a technique works best with large collections (in fact, it was carefully tuned this way). For very small tables, word distribution does not adequately reflect their semantic value, and this model may sometimes produce bizarre results.
    For example, although the word “MySQL” is present in every row of the articles table shown earlier, a search for the word produces no results:

    mysql> SELECT * FROM articles
    -> WHERE MATCH (title,body) AGAINST ('MySQL');
    Empty set (0.00 sec)

    The search result is empty because the word “MySQL” is present in at least 50% of the rows. As such, it is effectively treated as a stopword. For large data sets, this is the most desirable behavior: A natural language query should not return every second row from a 1GB table. For small data sets, it may be less desirable.

    A word that matches half of the rows in a table is less likely to locate relevant documents. In fact, it most likely finds plenty of irrelevant documents. We all know this happens far too often when we are trying to find something on the Internet with a search engine. It is with this reasoning that rows containing the word are assigned a low semantic value for the particular data set in which they occur. A given word may reach the 50% threshold in one data set but not another.

    The 50% threshold has a significant implication when you first try full-text searching to see how it works: If you create a table and insert only one or two rows of text into it, every word in the text occurs in at least 50% of the rows. As a result, no search returns any results. Be sure to insert at least three rows, and preferably many more. Users who need to bypass the 50% limitation can use the boolean search mode;
    http://dev.mysql.com/doc/refman/5.0/...-language.html
    http://dev.mysql.com/doc/refman/5.0/...t-boolean.html
    Addio Aldo, amico mio... [03/12/70 - 16/08/03]

  3. #3
    Utente di HTML.it L'avatar di bANART
    Registrato dal
    Jul 2005
    Messaggi
    662
    O_o

    Tutto mi sarei aspettato tranne che fosse 'normale' questa problematica/situazione.

    Grazie mille gm!
    Matteo Coletta - fotografia
    Fotografo Lanciano - Fotografia a Lanciano e Pescara

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.