开发者

Solr search/faceting results have strange behaviour: i only get "stemmed" strings (hope it's correct definition)

Sorry for a title that bad, but i di开发者_JS百科dn't know how to describe my problem. I'm using sunburnt (python interface) to query solr within my django app. When i'm searching, everything is ok, i get the full string. On the other hand, if i'm faceting (let's say on "job_title" field) i'm getting only the stemmed words

Like this:

<lst name="job_title">
    <int name="manag">17095</int>
    <int name="sale">7689</int>
    <int name="engin">6995</int>
    <int name="consult">4907</int>
    <int name="account">4710</int>
    <int name="develop">4509</int>
    <int name="senior">4366</int>

and so on... This is my text fieldType definition:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  <analyzer>
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.StopFilterFactory"
            ignoreCase="true"
            words="stopwords.txt"
            enablePositionIncrements="true"
            />
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
    <filter class="solr.PorterStemFilterFactory"/>
  </analyzer>
</fieldType>

i think the PorterStemFilter is the one screwing things up, but i need it to activate suggestions. Any help?


This is why you usually facet on unanalyzed fields. Add another field with StrField type, use a copyField directive to get the data there, and facet on this new string field.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜