You only have two more steps...
Add a new fieldType using the SimpleTextCodec
- Use the new fieldType in some fields
Add a new fieldType using the SimpleTextCodec
Add something like this to the <types> section
<fieldType name="string_simpletext" class="solr.StrField" postingsFormat="SimpleText" />
This is not a very interesting fieldType, notice it's based on the "StrField" which means that it's not analyzed in any way, so searching is only for the exact input. Of course you can use fieldTypes with analysis chains like this. Note that this is based on TextField.
<fieldType name="text_simpletext" class="solr.TextField" postingsFormat="SimpleText"> <analyzer> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
Use the new fieldType in some fields
Add some lines like this to the <fields> section
<field name="simple_string" type="string_simpletext" indexed="true" stored="true"/> <field name="simple_text" type="text_simpletext" indexed="true" stored="true"/>
At this point, you should have the SimpleText results in your SOLR_CODE/solr/example/solr/collection1/data/index directory, look for files of the form: *SimpleTest*.pst
As always, the first time someone actually follows instructions deficiencies pop out. Feel free to modify this page with whatever clarifications you think would be helpful.
Read full article from SimpleTextCodecExample - Solr Wiki
No comments:
Post a Comment