Page 1 of 1

special characters in search

Posted: Tue Jul 31, 2001 4:37 pm
by kdua
I am executing the following code..

<sum "%s" "/" $q ".php"> where query is insulin
<$urlquery = $ret>
<SQL "select count(*) mycount from html where Url likep $urlquery"></SQL>
I have created a metamorph Inverted index on Url
But this isn't giving me any results..whereas there are Urls in my database like www.fasthealth.com/i/insulin.php

It gives me a message saying the query wud require linear search, which wud be slow..Is there a way to specify while creating the index so that special characters like / and . are a part of index

Thanks..

special characters in search

Posted: Tue Jul 31, 2001 4:57 pm
by mark
Yes. Use addexp. Some examples can be found on this board. Here's one:
http://thunderstone.master.com/texis/ma ... 3b55e7a511

Also note, though, that a *leading* / means "rex" which will always be linear. You should make sure your search term starts with something other than /.

A simple search for "insulin" instead of "/insulin.php" with a metamorph index on url would find that record quite well.

special characters in search

Posted: Tue Jul 31, 2001 5:06 pm
by kdua
Wud the following script work for finding queries like:
i/insulin.php

<script language=vortex>
<timeout=-1></timeout>
<db=/path/to/webinator/db>
<a name=main>
<user=_SYSTEM>
<sql "drop index URLINDX"></sql>
<sql "set delexp=0"></sql>
<sql "set addexp='\alnum{1,99}'"></sql>
<sql "set addexp='\alnum{1,99}\/\.'"></sql>
<apicp keepnoise 1>
<sql "create metamorph index URLINDX on html(Url)"></sql>
</a>
</script>

special characters in search

Posted: Tue Jul 31, 2001 5:33 pm
by mark
No. That will index words with a trailing /. . You want an
expression more like
[\alnum/.]{1,99}