lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Akerø <>
Subject KeywordTokenizerFactory - trouble with "exact" matches
Date Wed, 29 Jan 2014 14:05:08 GMT
Hi, I'll try properly this time.

According to solr documentation the solr.KeywordTokenizerFactory should not
do any tokenizing at all. Thus, if I understand this correctly, it should
only return exact matches given that this is the only analyzer defined in
the field type. Such as the following config:

*       <fieldType name="keyword" class="solr.TextField"
*            <analyzer type="index">*
*                <tokenizer class="solr.KeywordTokenizerFactory"/>*
*                <filter class="solr.LowerCaseFilterFactory"/>*
*            </analyzer>*
*            <analyzer type="query">*
*                <tokenizer class="solr.KeywordTokenizerFactory"/>*
*                <filter class="solr.LowerCaseFilterFactory"/>*
*            </analyzer>*
*        </fieldType>*

*        <field name="number" type="keyword" indexed="true" stored="true"
required="false" />*

But it seems not to be this way for me. In the index i have values like "FE
009", "EE 009", "ED 009" and "FE 009-1" (without the quotes of course. But
when i search "FE 009" (without quotes), I get no results. It seems that I
have to add quotes to the searchquery in order to retrieve any results, but
that wont't work for me, as I later on have to expand the index with other
fields that need whitespace-tokenization and such, or would that work
regardless of quotes? I have come to understand that wrapping the query in
quotes forces it to be analyzed as one token, no matter what.

If I get this to work I would also like to add the
"solr.EdgeNGramFilterFactory" to the index side analyzer, thus adding
trailing wildcard matches. E.g. return "FE 009-1", "FE 009-2" as well as
"FE 009" when searching for "FE 009", but not "EE 009", and "ED 009". Would
that be an ok way to do it?

*Aleksander Akerø*
Mobil: 944 89 054

*Gurusoft AS*
Telefon: 92 44 09 99
Østre Kullerød

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message