Q:Text search for character entity references (*')

Could someone help us out. We are trying to locate documents where an element contains an apostrophe (').

A request like …?_xql=a/b[c=“'“] fails, i.e. it acts like _xql=a/b[c=””] which is not our intention.

Of course we also tried some variations like the hexadecimal variant or just an apostrophe. They all lead to the same (unwanted) result.

Does anyone know how we can get the desired result?

regards,
Rudolf

Hi Rudolf,

you cannot use * as a wildcard with the operator =. You must use ~= instead. This is the first reason why the query …?_xql=a/b[c=“'“] fails.
The second reason is more involved: The query …?_xql=a/b[c~=”
'”] will not produce the desired result as well. The reason is that ’ is defined as white space in Tamino. You can modify this classification by adding the following line to ino:transliteration (see Tamino documentation “Character Handling and Word Recognition” for details)
<ino:character ino:value=“'” ino:class=“character” />
Then, recreate text indexes and restart teh Tamino server to make changes take effect. After that, the query …?_xql=a/b[c~=“'”] will find all c elements which contain an '

Regards

Harald

Of course Harald, you’re right. Actually we did use the ~= operator and it does not work. You can easily test it yourself on any document type containing ' as text.

Regards,
Rudolf

Rudolf,

yes, that’s what I wrote: you must tell Tamino to handle ’ differently:

The query …?_xql=a/b[c~=“*'”] will not produce the desired result as well. The reason is that ’ is defined as white space in Tamino. You can modify this classification by adding the following line to ino:transliteration (see Tamino documentation “Character Handling and Word Recognition” for details)
<ino:character ino:value=“'” ino:class=“character” />
Then, recreate text indexes and restart the Tamino server to make changes take effect. After that, the query …?_xql=a/b[c~=“'”] will find all c elements which contain an '

This works - I have tested that.

Regards

Harald

You’re absolutely right. Thank you.


Regards,
Rudolf