Indexing "-" characters

Faiz
Posts: 109
Joined: Wed Jan 10, 2001 1:29 pm

Indexing "-" characters

Post by Faiz »

Hi,
I want to index "-", "+" and "_" characters and the expression I used is,
<sql "set addexp='\alnum=[\alnum\+\-\_]{0,30}'"></sql>
but it gives an invalid query term "-" in the log file. Where am I making a mistake? I know "-" has a different meaning in TEXIS, but still I want to index that character. Do i need to change the search script as well??
Thanx,
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Indexing "-" characters

Post by Kai »

A minus at the start of a query term negates that term, that is, the term is required to not be present for a hit. So a query of a single minus is not legal in Metamorph, because there's no term following it.

A minus between adjacent words, without spaces, makes them a phrase, ie. George-Washington will look for George and Washington as adjacent words, not just in the same document. This behavior of minus can be turned off with the statement: <SQL "set hyphenphrase=0"></SQL>; then the only way to make a phrase is to double quote it eg. "George Washington". (The negation behavior of minus at the start of a term cannot be turned off.)