Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [SOLVED] Zapytanie wyszukiwarki, Relevance, Boolean Mode
BlackHat
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 9.02.2010

Ostrzeżenie: (0%)
-----


Witam,
Mam takie zapytanie do MySQL:
  1. SELECT MATCH (
  2. tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer
  3. )
  4. AGAINST (
  5. '$searchterm'
  6. ) AS Relevance
  7. FROM czytelnia
  8. WHERE MATCH (
  9. tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer
  10. )
  11. AGAINST (
  12. '$searchterm'
  13. IN BOOLEAN
  14. MODE
  15. )
  16. HAVING Relevance > 0.2
  17. ORDER BY Relevance DESC
  18. LIMIT 0 , 160

Mam problem z tym że zamiast wyświetlić (tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer)
wyświetla mi kolumne relevance
Dziękuję za wszelkie sugestie.
Pozdrawiam,
BlackHat

Ten post edytował BlackHat 4.03.2010, 15:00:34
Go to the top of the page
+Quote Post
Mchl
post
Post #2





Grupa: Zarejestrowani
Postów: 855
Pomógł: 145
Dołączył: 17.07.2008
Skąd: High Memory Area

Ostrzeżenie: (0%)
-----


Nie wpisałeś tych kolumn na listę kolumn, to czego oczekujesz?

Kod
SELECT tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer,
MATCH (
tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer
)
AGAINST (
'$searchterm'
) AS Relevance
FROM czytelnia
WHERE MATCH (
tytul_pl, autor, tytul_en, summary_en, summary_pl, keywords_en, keywords_pl, tresc, kod, id2, rok, numer
)
AGAINST (
'$searchterm'
IN BOOLEAN
MODE
)
HAVING Relevance > 0.2
ORDER BY Relevance DESC

LIMIT 0 , 160
Go to the top of the page
+Quote Post
BlackHat
post
Post #3





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 9.02.2010

Ostrzeżenie: (0%)
-----


Dzięki biggrin.gif kombinowałem tak wcześniej, z tym że nie dałem przecinka pomiędzy numer a MATCH i mi sie krzaczyło teraz jest juz wszystko dobrze:D
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 15:59