Problems with Wildcard Queries / Own Filter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problems with Wildcard Queries / Own Filter

Björn Keil-3
Hello,

I am having a bit of a problem with Wildcard queries and I don't know how to pin it down yet. I have a suspect, but I kind find an error in it, one of the filters in the respective search field.

The problem is that when I do a wildcard query:
title:todesmä*
it does return a result, but it also returns results that would match title:todesma* It is not supposed to do that because, due to the filter, it's supposed to be equivalent to title:todesmae*

The reals problem is that if I search for title:todesmär* it does not find anything at all anymore. There are titles on the index that would match "todesmärsche" and "todesmärchen".

I have looked the Filter in a debugger, but I could not find anything wrong with it. It's supposed to replace the "ä" with "ae", which it does, calls termAtt.resizeBuffer() before it does and termAtt.length() afterwards. The result seems perfectly alright. What it does not change is the endOffset attribute of the CharTermAttribute object, that's probably because it's counting Bytes, not characters; I replaced a single two-byte char with a two one-byte chars, consequently the endOffset is the same.

Could anybody tell me whether there is anything wrong with the filter in the attachment?

GermanUmlautFilter.java (3K) Download Attachment