Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z match against, jeśli za dużo wyników
Forum PHP.pl > Forum > PHP
konradg
Może ktoś coś wie w tym temacie. Używam do wyszukiwania MATCH (`kolumna`) AGAINST ('szukany ciag') i teraz jeśli np. szukam jakiegoś ciągu i jest w danej kolumnie zbyt dużo pasujących wierszy to nie zwraca żadnych wyników.
Np. wpisuje php:
Jeśli miałem w danej tabeli 20 wiersz z tym słowem to było ok, jak mam przykładowo 30 to już nie działa.
Czy to się da jakoś naprawić?
kfc4
Może jakimś limitem? A wyświetla jakiś błąd czy tylko nie zawiera wyników?
konradg
Cytat(kfc4 @ 5.08.2009, 09:27:23 ) *
Może jakimś limitem? A wyświetla jakiś błąd czy tylko nie zawiera wyników?

No właśnie po prostu nic nie zwraca
Tak wygląda zapytanie dokładnie
  1. SELECT id, tytul, MATCH(tytul,tresc) AGAINST ("php") AS scores
  2. FROM artykuly WHERE MATCH(tytul,tresc) AGAINST ("php") ORDER BY scores DESC
kfc4
Spróbuj dać limit.
phpion
@kfc4:
Głupoty pleciesz.

@kondradg:
http://dev.mysql.com/doc/refman/5.0/en/ful...l-language.html

Cytat
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:

Kod
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.
konradg
Cytat(phpion @ 5.08.2009, 10:37:52 ) *

No dzięki. Nie wiedziałem o tym.

A to tak jeszcze się spytam. Da się to jakoś inaczej obejść niż przy pomocy IN BOOLEAN MODE?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.