On 12/18/2017 12:29 AM, Amin Raeiszadeh wrote: > thanks too much Erick and mikhail. > i change SloppyPhraseScorer class for my custom behavior with some fields. > so i need to index some fields with customized gap between terms of fields. > i'm not profession with solr and i think with schema.xml only i can > set fixed gap increment between terms of field but i need to calculate > base on some formula and then decide how much gap should be set > between each term. > i think i should use some thing like plug-in or inject some code to > index flow of solr as you described.
Most likely what you would need is a custom TokenFilter implementation that can determine what custom gaps are needed and implement them. You would then need to make sure Solr knows about the jar containing that plugin, and add that filter as a step in the analysis chain in the schema for your core/collection. I don't know anything about how to write a TokenFilter, but there are lots of implementations in the Lucene code. Thanks, Shawn