I don't see the brackets that mark the group you actually want to
capture. As per:
http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analysis/pattern/PatternCaptureGroupTokenFilter.html

I am also not sure if you actually need "{0,1}" part.

Regards,
   Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 7 March 2016 at 04:25, Jay Potharaju <jspothar...@gmail.com> wrote:
> Hi,
> I have a custom field for getting the first letter of an firstname. For
> this I am using PatternCaptureGroupFilterFactory.
> This is not working as expected, not able to parse the data and get the
> first character for the string. Any suggestions on how to fix this?
>
>  <fieldType class="solr.TextField" name="text_firstLetter">
>
>       <analyzer>
>
>         <tokenizer class="solr.KeywordTokenizerFactory"/>
>
>         <filter class="solr.UpperCaseFilterFactory"/>
>
>         <filter class="solr.PatternCaptureGroupFilterFactory" pattern=
> "^[a-zA-Z0-9]{0,1}" preserve_original="false"/>
>
>        </analyzer>
>
>     </fieldType>
>
> --
> Thanks
> Jay

Reply via email to