special characters in search

Post Reply
kdua
Posts: 10
Joined: Mon Jul 23, 2001 3:01 pm

special characters in search

Post 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..
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

special characters in search

Post 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.
kdua
Posts: 10
Joined: Mon Jul 23, 2001 3:01 pm

special characters in search

Post 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>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

special characters in search

Post by mark »

No. That will index words with a trailing /. . You want an
expression more like
[\alnum/.]{1,99}
Post Reply