Exact match limiting to multiple subdirectories

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

Exact match limiting to multiple subdirectories

Post by Thunderstone »



I'm trying to limit queries to one of two subdirectories or
both subdirectories. This works fine for Rank searching.

The problem I experience is that when posting queries
that change the Proximity value to anything other than
"rank" the results don't match the query but they still
match the subdirectory. I.E. the hitlist is from the Url
table in the order in which the pages were "walked" so long
as they appear in the correctly identified
subdirectory(ies).

The SQL syntax I attempted is:

<SQL SKIP=$oldskip MAX=11
"select id, Url, Title, Body, length(Body) Size
from html
where Url matches $dbs_dir OR Url matches
$prntdx_dir and Title\Meta\Body like $query">
<matchline>

I am wondering...
1) How to make this work?
and 2) Is there a better way to compose the SQL? (probably)


--John
John.Little@Duke.edu




User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

Exact match limiting to multiple subdirectories

Post by Thunderstone »




You should do the LIKE search first, and parenthesize the
and/or logic to make the precedence clear. AND groups higher than
OR, so in your query the LIKE only matches on the 2nd dir:

<SQL SKIP=$oldskip MAX=11
"select id, Url, Title, Body, length(Body) Size
from html
where Title\Meta\Body like $query
and (Url matches $dbs_dir OR
Url matches $prntdx_dir)">

-Kai


Post Reply