Re: Help understanding an oracle text search term

From: <>
Date: Wed, 6 May 2009 07:47:29 -0700 (PDT)
Message-ID: <>

On May 6, 3:24 am, "Bobby Z." <> wrote:
> On May 6, 12:35 am, wrote:
> > I have a varchar2 column (col2) and I've created an CTXSYS.CONTEXT
> > index for it (using the empty stoplist).
> > I'm running a query that has
> >    ... AND  CONTAINS(col2, 'G"%') > 0
> > This results in an error "DRG-51030: wildcard query expansion resulted
> > in too many terms"
> > But if I change the search term to 'G%' (without the double-quote)
> > then I don't get the error.
> > I'm trying to understand why the double-quote causes the error and
> > what it means in a CONTAINS search.
> > Is a double-quote special in a CONTAINS search?
> > Thanks,
> > Kevin.
> Oracle version? And yes, double-quotes have special meaning in Text
> queries, especially for XML-specific HASPATH/INPATH functions. Since
> double-quote is a punctuation character and as such can not be part of
> any word, your 'G"%' query is actually meaningless, so no wonder the
> query parser throws DRG-51030 back at you.

Oracle Database 10g Enterprise Edition Release - 64bit Production

Your answer does help but I'm still looking for more detail. For example, if I change the search term to '"G%' (that is a singlequote,  followed
by a double-quote, followed by the G character, etc.) then by your reasoning the
query is also meaningless but it doesn't give me an error and returns results. Why
would that be?

I'm not using the HASPATH or INPATH functions. I've been reading the Oracle Text Reference
and Application Developers Guide (b14217 and b14218) and I haven't found any mention
of how punctuation is handled - specifically how double-quotes are treated.
I'm about to read more about the lexer as that might give me more information.

Kevin. Received on Wed May 06 2009 - 09:47:29 CDT

Original text of this message