Browse files

上传两个配文件

  • Loading branch information...
1 parent fb5154f commit db9ded13f6c6ac51fbd934a6c24124da289b2178 @mlzboy committed Aug 19, 2011
Showing with 31 additions and 3 deletions.
  1. +22 −2 sunspot/solr/solr/conf/schema.xml
  2. +9 −1 sunspot/solr/solr/conf/solrconfig.xml
View
24 sunspot/solr/solr/conf/schema.xml
@@ -45,6 +45,21 @@
-->
<schema name="sunspot" version="1.0">
<types>
+<fieldType name="textComplex" class="solr.TextField" >
+ <analyzer>
+ <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="complex" dicPath="dic"/>
+ </analyzer>
+ </fieldType>
+ <fieldType name="textMaxWord" class="solr.TextField" >
+ <analyzer>
+ <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" dicPath="dic"/>
+ </analyzer>
+ </fieldType>
+ <fieldType name="textSimple" class="solr.TextField" >
+ <analyzer>
+ <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="n:/OpenSource/apache-solr-1.3.0/example/solr/my_dic"/>
+ </analyzer>
+ </fieldType>
<!-- field type definitions. The "name" attribute is
just a label to be used by field definitions. The "class"
attribute and any other attributes determine the real
@@ -118,7 +133,10 @@
<!-- *** This field is used by Sunspot! *** -->
<field name="class_name" stored="false" type="string" multiValued="false" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
- <field name="text" stored="false" type="string" multiValued="true" indexed="true"/>
+ <!--<field name="text" stored="false" type="string" multiValued="true" indexed="true"/>-->
+<field name="simple" type="textSimple" indexed="true" stored="true"/>
+<field name="complex" type="textComplex" indexed="true" stored="true"/>
+<field name="text" type="textMaxWord" indexed="true" stored="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="lat" stored="true" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
@@ -231,8 +249,10 @@
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
- <solrQueryParser defaultOperator="AND"/>
+ <solrQueryParser defaultOperator="OR"/>
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
+<copyField source="text" dest="simple" />
+<copyField source="text" dest="complex" />
</schema>
View
10 sunspot/solr/solr/conf/solrconfig.xml
@@ -424,6 +424,7 @@
<!-- <cacheControl>max-age=30, public</cacheControl> -->
</httpCaching>
</requestDispatcher>
+
<!-- requestHandler plugins... incoming queries will be dispatched to the
correct handler based on the path or the qt (query type) param.
Names starting with a '/' are accessed with the a path equal to the
@@ -435,6 +436,7 @@
<requestHandler name="standard" class="solr.SearchHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
+ <str name="defType">extlucene</str>
<str name="echoParams">explicit</str>
<!--
<int name="rows">10</int>
@@ -443,6 +445,11 @@
-->
</lst>
</requestHandler>
+ <requestHandler name="/mmseg4j" class="com.chenlb.mmseg4j.solr.MMseg4jHandler" >
+ <lst name="defaults">
+ <str name="dicPath">dic</str>
+ </lst>
+ </requestHandler>
<!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
<!-- remove the <lst name="master"> section if this is just a slave -->
<!-- remove the <lst name="slave"> section if this is just a master -->
@@ -912,7 +919,8 @@
<queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
- <!-- example of registering a query parser
+<queryParser name="extlucene" class="com.chenlb.solr.search.ExtLuceneQParserPlugin"/>
+<!-- example of registering a query parser
<queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
-->
<!-- example of registering a custom function parser

0 comments on commit db9ded1

Please sign in to comment.