Good to hear. Actually, though, this is a little bit of an XY problem.
I think a better solution would be to use
PatternReplaceCharFilterFactory on the field to replace all sequences
of whitespace characters with a single space at both query and index
time.

That charfilter replaces whatever you tell it to _before_
tokenization. Assuming, of course, that this fits your problem ;)

Best,
Erick
On Wed, Dec 12, 2018 at 12:41 AM Michael Aleythe, Sternwald
<michael.aley...@sternwald.com> wrote:
>
> Hey Erik,
>
> thanks a lot for your suggestion. It lead me on the rigth path. What actually 
> did the trick was, sending the tab as unicode: 
> IPTC_2_080_KY:"\u0009bus\u0009bahn" matched perfectly.
>
> Best,
> Michael
>
> -----Ursprüngliche Nachricht-----
> Von: Erick Erickson <erickerick...@gmail.com>
> Gesendet: Dienstag, 11. Dezember 2018 18:45
> An: solr-user <solr-user@lucene.apache.org>
> Betreff: Re: Keyword field with tabs in Solr 7.4
>
> You are probably in "url-encoding hell". Add &debug=query to your search and 
> check the parsed query returned to see what Solr actually sees. Try 
> url-encoding the backslash *%5C" maybe?
>
> Best,
> Erick
> On Tue, Dec 11, 2018 at 1:40 AM Michael Aleythe, Sternwald 
> <michael.aley...@sternwald.com> wrote:
> >
> > Hey everybody,
> >
> > i have a Solr field keyword field defined as:
> >
> > <fieldType name="text_keyword" class="solr.TextField">
> >              <analyzer>
> >                            <tokenizer class="solr.KeywordTokenizerFactory" 
> > />
> >              </analyzer>
> > </fieldType>
> >
> > <dynamicField name="*_KY" type="text_keyword"              indexed="true" 
> > stored="true"             termVectors="false" multiValued="false" />
> >
> > Some documents have tabs (\t) indexed in this field, e.g. 
> > IPTC_2_080_KY:"\tbus\tbahn"
> >
> > How can i query this content? I tried  "\tbus\tbahn", 
> > \\tbus\\tbahn<file://tbus/tbahn> and " bus bahn" but nothing matches. Does 
> > anybody know what to do?
> >
> > Regards
> > Michael

Reply via email to