Does anyone know if it's possible to filter index a numeric range such as "1-5" to be "1","2","3","4","5"? I can't find any filter factories that does this.
Example: "1-5 ABC" gets indexed as "1 ABC", "2 ABC", "3 ABC", "4 ABC", "5 ABC"
Does anyone know if it's possible to filter index a numeric range such as "1-5" to be "1","2","3","4","5"? I can't find any filter factories that does this.
Example: "1-5 ABC" gets indexed as "1 ABC", "2 ABC", "3 ABC", "4 ABC", "5 ABC"
What you want can be achieved for sure, but it might not be straightforward.
One possible way of doing it without writing java code, might by using PatternReplaceFilter in your analysis chain. My regex expertise is very basic, so I am not able to say for sure if it is possible or not...Your regex should be able to match and capture the '1-3' type tokens, and then replace them with '1', '2', '3'. But I doubt it's possible to do this, as you need to emit several tokens per match...
The sure way to achieve this is to write your custom filterfactory class, and handle the logic there. This is possible but requires java expertise.