Word Expression

Post Reply
mjacobson
Posts: 204
Joined: Fri Feb 08, 2002 3:35 pm

Word Expression

Post by mjacobson »

I have written a Vortex script that allows my customers to search a Vortex database. The problem I am having is when my users search for things like "T-72".

They will get the results for "T-72" but not results for "T72" or "T 72". All of these are good hits.

If I write the query as '/T=-?"72"=' I can get all of these returns, but the search takes a long time to run. I would also have difficulty trying to get people to use this syntax.

I am using "<sql "set addexp = '[\alnum\/\-]{2,99}'"></sql>" for my word definition. Should this be changed to something else or is there a better way to handle this type of query?
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Word Expression

Post by John »

For the two cases "T-72" and "T 72" and index expression of <SQL "set addexp='[\alnum]{1,99}'"> will work, as the default behaviour of Texis and the Metamorph engine is to treat a hyphen as a phrase connector, and it will also match a space.

You would need to rewrite the query slightly to get the "T72" to match, e.g. "(T 72,T72)" which indicates either the phrase "T 72" or the word T72.
John Turnbull
Thunderstone Software
Post Reply