Hello Jochen

What are your tokenizers? I guess it should be 'KeywordTokenizerFactory'. To fully understand, you might send the whole analyzer chain.

But there might be a simple mistake in your pattern, character classes are enclosed by square brackets. We do a replace of all non-alphanumeric characters like this:
**********************************
<filter class="solr.PatternReplaceFilterFactory"
        pattern="[^\w]+"
        replacement=""
        replace="all"
/>
**********************************

If that helps.
Regards from Basel
Oliver

-------- Original-Nachricht --------
Betreff: removing whitespaces in query
Von: Jochen Lienhard <lienh...@ub.uni-freiburg.de>
An: solr-user@lucene.apache.org
Datum: 07.03.2013 10:33

Hello,

we have indexed a field, where we have removed the whitespaces before the 
indexing.

For example:

50A91
Frei91\:9984

Now we want allow the users to search for:

50 A 91
Frei 91 \: 9984

Our idea was to add a PatternReplaceFilterFactory in the query analyzer to 
remove the
whitespaces:
<charFilter class="solr.PatternReplaceFilterFactory" pattern="(\s+)" 
replacement=""
replace="all"/>

But it does not work.

For normal queries - we are using vufind als frontend - we can remove the 
whitespace in
the yaml part, but if
the user search with wildcards ... the yaml does not work ... so we hope to 
find a
solution in solr.

We are using solr 3.6.

Thanks for ideas and hints.

Greetings from Germany

Jochen


Reply via email to