Page 1 of 1

Metamorph matching substrings

Posted: Thu Aug 07, 2003 11:38 am
by source1Tamer
I have a metamorph index on a table. It returns substrings matches, the metamorph index is Fresh and the table is not updated after creation of the index.
here is an example:

<apicp alpostproc 1>
<apicp alintersects 1>
<apicp alwithin on>
<db=dbpath is here>
<$keywords='+("t 20",ritonavir) @0 w/50'>
<sql "select count(*) as counts from dailythreads where Title\Body like $keywords and New=1">
$counts
</sql>

the $count is 1193 because there are matches like "Oct 2002" related to the keyword "t 20", but when I take the "t 20" off, the $count variable is 1 which is a good match for the keyword "ritonavir".

thankx in advance..
T

Metamorph matching substrings

Posted: Thu Aug 07, 2003 12:02 pm
by mark
The "20" is considered non-language so it's allowing substring matching. You can add \digit to langc to treat numbers as language. See http://www.thunderstone.com/site/texisman/node150.html and http://www.thunderstone.com/site/texisman/node148.html

BTW, the quotes within a paren list are not needed and are discouraged. Phrases are automatically bound by the parens and commas with a list. <$keywords='+(t 20,ritonavir) @0 w/50'>

Metamorph matching substrings

Posted: Thu Aug 07, 2003 2:32 pm
by source1Tamer
Should I set this before index creation?
I tried:
<sql "set addexp='[\alnum\x2d\x2e\x21\x24\x26\x27\x40]{2,99}'"></sql>
<$langcstring = "[\alpha\' \-\digit]">
<sql "set langc=$langcstring"></sql>
<sql "create metamorph inverted index xdailythreadsbod on dailythreads(Title\Body,topics\categories,siteid,New,ispost)"></sql>


but it didn't work
also I tried (from a another message board thread) and also didn't work.

<$strc="[\alnum\'']">
<$strw="[\alnum\''\-]">
<sql "set langc=$strc"></sql>
<sql "set wordc=$strw"></sql>


the texis version is: 4.00.1023473374 of Jun 7, 2002


T

Metamorph matching substrings

Posted: Thu Aug 07, 2003 2:50 pm
by John
It should be set before doing the query. You might also want to index single character words i.e. {1,99}, f that sort of query is common, which would allow the 't' to be indexed and use the index for it.

Metamorph matching substrings

Posted: Thu Aug 07, 2003 3:17 pm
by source1Tamer
so is "[\alpha\' \-\digit]" the right expression to use for langc?
Should I leave "wordc" optimizer with the default, or should I change it too to be the same as langc as it says in the documentaion?

Metamorph matching substrings

Posted: Thu Aug 07, 2003 4:17 pm
by mark
Yes, the expression is good. It's a good idea to keep wordc and langc in sync so modify both.