Dear All, Am using DB2 9.7 express-c on ubuntu 10.04 and using DB2 Text search over XML documents in my application.

My problem is with handling of special characters(~ { } { }( ) : ! = && || - etc.) within search query.DB2 documentation tells to escape special characters with \ i.e. Use \ so that special characters are analyzed as part of the query.As an example, to return documents that contain (1+1):2 search query should be \(1\+1\)\:2

But DB2 is ignoring all escaped characters instead of considering them in search query i.e. searching for ~abc(Search Query \~abc) returns documents containing any special character before abc like !abc, (abc , :abc !!

This is my search query for above search(searching ~abc)

"xquery <Documents>{
for $i in db2-fn:sqlquery("SELECT DOCUMENT FROM SPEC_DOCS WHERE CONTAINS(DOCUMENT,'@xpath:''/Document/General_Description//Spec[. contains (""\\~abc"")]''') = 1") return <Document>

Is there any mistake in above query ? Or is there any specific configuration for this in DB2 Text search ?

Extending the above case, if i search only any escaped special character e.g. \~ , \: , DB2 is returning all documents which again suggests that escaped characters are just ignored in DB2 text search.

Please guide.