Too many elements

Post Reply
tsphillips
Posts: 2
Joined: Fri Jan 03, 2003 12:27 pm

Too many elements

Post by tsphillips »

I am receiving the below error message from a Vortex script. The number of editions in our database will grows without bounds. Is there a way to rephrase this query to avoid the 199 element limit?

<!-- SELECT count(*) rec_count,edition FROM html
WHERE ((title likep $tquery)) AND (edition like $pubeditions) GROUP BY edition ORDER BY rec_count DESC -->
<!-- 100 /bin/search_janes:460: truncating "jacm01" list at 199 elements in the function build set lists -->
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Too many elements

Post by mark »

There are a couple of options. I'm guessing that your edition field only contains one edition name and that pubeditions contains a list of values that would exacly match those editions. In that case I would use "in" instead of "like". It has no limit. It requires a little setup though. Something like:
<sum "%s|" $pubeditions>
<$pe=(convert($ret, 'varstrlst' ))>
<sql row "select ...AND edition in ($pe) group by...">
In the sum replace the "|" with any character that will never occur in your pubedition values.

If your edition field contains multiple editions per record such that you have to use "like" you can build up the query putting 199 terms in each set and using 0 intersections. Something like
@0 (199,terms) (next,199,terms) ...
That will get you up to 19900 terms (there's a limit of 100 sets per like query.

We expect to be removing those limits on the like query in the not-to-distant future.
Post Reply