Solr:Text analysis



 
 

 



 

 

 

 

 

------------------------------------------------------------------------------------------------------------------------------------

Defining a custom field type for microblog text



 



 



 

------------------------------------------------------------------------------------------------------------------------------------

Advanced text analysis



 
 
 

How do you select the right text analyzer during indexing? Assuming you want to index all your documents regardless of language in the same index, a simple solution would be to use a unique field for each language. Suppose we want to index French tweets in our microblog search application. We could define the following field:

<field name="text_fr" type="text_microblog_fr"
indexed="true" stored="true" />

 

-------------------------------------------------------------------------------------------------------------------------------------

Integrate jcseg with solr to deal with chinese tokenizer

1.cp  jcseg-core-1.9.5.jar and   jcseg-solr-1.9.5.jar  to solr-4.7.0/example/solr-webapp/webapp/WEB-INF/lib/

2. cp lexicon dir to solr-4.7.0/example/solr-webapp/webapp/WEB-INF/lib/

3. alter schema.xml add fildtype

<fieldtype name="textComplex" class="solr.TextField">
   <analyzer>
       <tokenizer class="org.lionsoul.jcseg.solr.JcsegTokenizerFactory" mode="complex"/>
       <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ch.txt"/>
    </analyzer>
</fieldtype>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值