Skip to Main Content

Wildcards in CTXCAT grammar vs. CONTEXT grammar

762376Mar 24 2010 — edited Mar 26 2010
I've got a question about using wildcards in the CONTEXT grammar, when working with a catalog (CTXCAT index). For the application in question, the simpler CTXCAT grammar is almost exactly what I need, but there are a few circumstances in which I want to be able to take advantage of the flexibility of the CONTEXT grammar. I am able to do that using a query template, but when the query in question includes wildcards, I sometimes see behavior that I do not understand. Here's a query that works perfectly when expressed in the CTXCAT grammar:

SELECT count(*)
FROM ItemKeywordSearch iks
WHERE CATSEARCH(iks.ItemKeywords, '403(b)*', null) > 0;

When I try to restate that same query using the CONTEXT grammar like this:

SELECT count(*)
FROM ItemKeywordSearch iks
WHERE CATSEARCH(iks.ItemKeywords, '<query><textquery grammar="CONTEXT">403(b)%</textquery></query>', null) > 0;

I get a "DRG-51030: wildcard query expansion resulted in too many terms" error. I'm guessing the issue is related to some interaction between the parentheses characters and the wildcard; I don't see the same error if I remove the parentheses from the query.

Can anyone help me understand the cause of this issue, and suggest a way I can resolve or work around it?

Thanks,
Tim
Comments
Post Details
Added on Mar 24 2010
2 comments
2,115 views