Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Add ChineseAnalyzer to the mix for *_zh_text fields

Erik Hatchere136c158222b
diff --git a/client/ruby/solr-ruby/solr/conf/schema.xml b/client/ruby/solr-ruby/solr/conf/schema.xml
index 02e74010c99..ca692a19122 100755
--- a/client/ruby/solr-ruby/solr/conf/schema.xml
+++ b/client/ruby/solr-ruby/solr/conf/schema.xml
@@ -134,17 +134,16 @@
</fieldtype>
<fieldtype name="text" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StandardFilterFactory"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- <analyzer type="query">
+ <analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldtype>
+
+ <fieldtype name="text_zh" class="solr.TextField">
+ <analyzer class="org.apache.lucene.analysis.cn.ChineseAnalyzer"/>
+ </fieldtype>
<!-- Less flexible matching, but less false matches. Probably not ideal for product names,
@@ -194,6 +193,7 @@
Longer patterns will be matched first. if equal size patterns
both match, the first appearing in the schema will be used. -->
<dynamicField name="*_facet" type="string" indexed="true" stored="true" multiValued="true"/>
+ <dynamicField name="*_zh_text" type="text_zh" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_text" type="text" indexed="true" stored="true" multiValued="true"/>
</fields>
diff --git a/client/ruby/solr-ruby/solr/lib/lucene-analyzers-2.2-dev.jar b/client/ruby/solr-ruby/solr/lib/lucene-analyzers-2.2-dev.jar
new file mode 100644
index 00000000000..23abb447160
--- /dev/null
+++ b/client/ruby/solr-ruby/solr/lib/lucene-analyzers-2.2-dev.jar
@@ -0,0 +1,2 @@
+AnyObjectId[d738affcf4ef0734391bee0e7ba9cb22860770c6] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file