Trouble with LIKEPROWS

Post Reply
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

Trouble with LIKEPROWS

Post by tboyer »

I'm having trouble getting a query to obey LIKEPROWS.

<sql "SET likeprows = 20;"></sql>
<sql "select id from table where flag='0' and textfield likep $pterms "></sql>

I'm finding that LIKEPROWS will not operate when the WHERE includes the flag field -- btree index. I get 8000 results even with LIKEPROWS set to 20. Is there a way to get around this?

Thanks,

Tom
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Trouble with LIKEPROWS

Post by mark »

If you only want a certain number of results from <sql> use the max=# paramater, not likeprows.

<sql max=20 "select ...">
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

Trouble with LIKEPROWS

Post by tboyer »

Mark,

I have allmatch turned off. If the likep is going to return 10,000 bills and I have max=20, is it giving me the best 20 matches or is it cutting off processing before it fully evaluates and ranks the 10,000? In that case it would be better for me to keep the 10,000 in the set.
Post Reply