Skip to content

Commit

Permalink
上传两个配文件
Browse files Browse the repository at this point in the history
  • Loading branch information
mlzboy committed Aug 19, 2011
1 parent fb5154f commit db9ded1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
24 changes: 22 additions & 2 deletions sunspot/solr/solr/conf/schema.xml
Expand Up @@ -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
Expand Down Expand Up @@ -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! *** -->
Expand Down Expand Up @@ -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>
10 changes: 9 additions & 1 deletion sunspot/solr/solr/conf/solrconfig.xml
Expand Up @@ -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
Expand All @@ -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>
Expand All @@ -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 -->
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit db9ded1

Please sign in to comment.