Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-18 23:31:38

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Can someone translate the search query for me?

Search queries in Textpattern look more or less like this:

SELECT * , unix_timestamp( Posted ) AS uPosted,
MATCH (
  Title, Body
)
AGAINST (
  'foo bar'
) AS score
FROM `textpattern`
WHERE 1
AND STATUS = '4'
AND Posted < now( )
AND (
  Title
    RLIKE 'foo bar'
  OR Body
    RLIKE 'foo bar'
)
AND Section != 'excluded'
AND Section != 'sections'
ORDER BY score DESC
LIMIT 0 , 10

I understand the fulltext bit, but why is it paired up with RLIKE? When I remove the RLIKE portion of the query, search loosens up and behaves as I believe it should, in a non-strict manner. But with the RLIKE clause, it becomes pretty tough to find what you’re looking for.

Offline

#2 2005-11-18 23:38:22

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Can someone translate the search query for me?

rlike is there to find all the stuff that match/against won’t (words shorter than 4 characters, Chinese words, non-word sequences, etc).

You’re seeing fewer results because it’s looking for the exact phrase, not individual words. The crockery branch does individual word searching.


Alex

Offline

#3 2005-11-19 00:46:18

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Can someone translate the search query for me?

Ah – so what I posted is I believe from v4.0.2, so if I were to debug out the same query from crockery, the query would differ? I’ll take a look.

Offline

Board footer

Powered by FluxBB