i am using regexp character filter in couchbase for my analyzer. desirable result following
phuong 1 -> phuong_1
phuong 12 -> phuong_12
Configuration character filter in Couchbase Web Console following
Regular expression : ([a-z])\s+(\\d)
Replacement: $1_
Couchbase's Full text search is implemented in golang. Here's a playground illustration of how your regular expression works ..
https://play.golang.org/p/Jray7DTYZam
As you can see in the illustration above, $1x is equivalent to ${1x}, not ${1}x. So your replacement needs to be updated to ${1}_
.
Now this said, we have a limitation that variables ($1, ${2} etc.) aren't supported at the moment. I've created an internal ticket to extend support for this.