I'm using solr, I'm using StandardTokenizerFactory in the text field but I don't want to split on the underscore. Do I have to use another toknizer like PatternTokenizerFactory or I can do this with StandardTokenizerFactory ? as I need the same functionality of StandardTokenizerFactory but without split on underscore.
相关问题
- Eager-loading association count with Arel (Rails 3
- Solr Deduplication (dedupe) giving all zeros in si
- Rails simple model attributes not saved to databas
- Solr (Sunspot), max results more than 30?
- jquery-ui progressbar not showing
相关文章
- “No explicit conversion of Symbol into String” for
- Rspec controller error expecting <“index”> but
- Factory_girl has_one relation with validates_prese
- Rails: Twitter Bootstrap Buttons when visited get
- Solr - _version_ field must exist in schema and be
- is there a “rails” way to redirect if mobile brows
- Got ActiveRecord::AssociationTypeMismatch on model
- superclass mismatch for class CommentsController (
I don't think you can do it in StandardTokenizerFactory. One solution is to first replace underscores with something the StandardTokenizerFactory won't process and something your documents won't otherwise contain. For example, you can first replace
_
withQQ
everywhere with PatternReplaceCharFilterFactory and pass through StandardTokenizerFactory and then replaceQQ
with_
using PatternReplaceFilterFactory. Here is the fieldType definition to do it:And here is a screen shot of what happens:
Adding just following seems to do trick for StandardTokenizerFactory as StandardTokenizerFactory splits at hyphen "-".