Implementation of substring search in omegascript

Olly Betts olly at survex.com
Tue Feb 16 10:11:30 GMT 2016


On Mon, Feb 15, 2016 at 12:41:38AM +0000, James Aylett wrote:
> ensure means that the command requires either a query (‘Q’) or a query
> and a match (‘M’) to have been evaluated in the script up to that
> point. (See lines 1246–1248 of query.cc.)

To give a little more context, the reason why we don't parse the query
or run the match until we have to is that there are commands which set
parameters for query construction and for the match.  For example, if
you don't want to require AND, OR, etc be written in all capitals, you'd
use this near the start of your template:

$set{flag_boolean_any_case,1}

> (Note that it looks to me like there’s a bug in the evalargs handling,
> where minargs == N.)

Although it isn't clearly documented, (minargs == N) means just treat
all the content as one argument (rather than splitting it at commas).

In this case, evalargs is ignored - arguably a bug, but it's a latent
one as (minargs == N) is only actually used for comments, where such
splitting would be a waste of effort:

    ${This is a comment, do you see?}

Cheers,
    Olly



More information about the Xapian-devel mailing list