perform calculation in sandr

Post Reply
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

perform calculation in sandr

Post by barry.marcus »

We have a bunch of queries that contain proximity operators (e.g., w/4) and we would like to make a simple modification to our code so that the number is doubled. That is, if the query is "+reqterm* @0 nearterm* w/3" we'd like to send "+reqterm* @0 nearterm* w/6" to SQL.

My idea was (conceptually) to use sandr to search the query phrases for "w\/\digit" and replace it with something like "w\{3} * 2". That is, to do the math right inside the replacement portion of sandr. Is this do-able? If so, I can't figure out how. Is there an obviously easier way that I'm not seeing?

Thanks in advance
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

perform calculation in sandr

Post by John »

You can use sandcall to call a function on the match.
John Turnbull
Thunderstone Software
Post Reply