2015-06-23 84 views
0

我想將DB字段索引到多值字段。Solr splitBy沒有任何影響

數據-config.xml中:

<entity name="car_type" transformer="ClobTransformer" query="select car_data from cars"> 
<field column="CAR_DATA" splitBy="\$" clob="true"/> 

schema.xml中:

<field name="CAR_DATA" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> 
    <analyzer type="index"> 
      <tokenizer class="solr.PatternTokenizerFactory" pattern="[\.|\s|\-|\~]"/> 
    <!--<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> --> 
    <!-- in this example, we will only use synonyms at query time 
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> 
    --> 
    <filter class="solr.LowerCaseFilterFactory"/> 

    </analyzer> 
    <analyzer type="query"> 
      <tokenizer class="solr.PatternTokenizerFactory" pattern="[\.|\s|\-]"/> 
    <!--<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> 
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> --> 
    <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
</fieldType> 

的spiltBy有沒有影響,我得到的價值是,但我希望得到價值清單。

+0

什麼是你索引的價值? – MatsLindh

+0

來自DB的值,例如car1〜type1 $ car2〜type2 – user1826382

回答

0

您需要添加RegexTransformer。 試試這個:

<entity name="car_type" transformer="ClobTransformer,RegexTransformer" query="select car_data from cars"> 
相關問題