elasticsearch


Using regular expression while specifying mapping char filter


ElasticSearch supports mapping char filter, where in one can specify a key and its corresponding value. I want to use regular expression in key.
The regular expression I am trying is basically to catch all uppercase symbols ending with I and convert them to strings ending with l. So this looks something like
ABCI => ABCl
String before I is not fixed, hence I am writing regular expression.
I have figured out the left hand part of the expression as [A-Z]+I but I am not able to decide what should be written on the right hand side so that I can catch string ABC as well.
My question is can we use regular expression in mapping char filter. If yes then how can I write the concerned regular expression(especially the right hand side part).
Use Pattern Replace Char Filter:
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"char_filter": [
"my_char_filter"
]
}
},
"char_filter": {
"my_char_filter": {
"type": "pattern_replace",
"pattern": "([A-Z]+)(I)$", ==> Patterm containg uppaer case characters ending with I
"replacement": "$11" => Replacing Group 1 with '1'
}
}
}
}
}
hope this helps!!

Related Links

Elasticsearch filter on mulitple nested paths
Need to Sort the _term in elastic search aggregation result
Why search_analyzer (keyword) does not work with edgeNgram index_analyer?
Elasticsearch startup: not available immediately
Elasticsearch Partial Fields With Inner Hits
ElasticSearch issue when adding new path.data
To copy an index from one machine to another in elasticsearch
Elasticsearch 2.0: how to delete by query in Java
Erroneour match using snowball analyzer
ElasticSearch 2.0 upgrade now can't connect to server
Elasticsearch layered ordering
Elasticsearch significant terms on nested objects
System Configuration for 3 node elasticsearch cluster
Nest - how to write a span near query with multiple clauses?
low disk watermark [??%] exceeded on
Why are shards getting initialized and relocated during bulk insert

Categories

HOME
orientdb
powerbi
functional-programming
activex
antd
command-prompt
histogram
informatica
autocomplete
web2py
javafx-8
u-boot
tweepy
static-analysis
anchor
fbloginview
graphdb
grocery-crud
sslhandshakeexception
squirrel-sql
fresco
web-deployment
asciimath
http-authentication
deepfreeze
libgit2
altium-designer
connection-refused
stackexchange.redis
perfino
raima
prompt
pyspark-sql
openbr
locks
winrm
payeezy
polyml
busboy
aurelia-cli
imgur
export-to-pdf
grails-spring-security
yoast
return-type
image-registration
libreoffice-writer
uiautomatorviewer
phppgadmin
maven-jaxb2-plugin
android-webservice
nrf51
email-injection
portal
elastic4s
metabase
java-2d
msg
openquery
jtag
meld
ajaxmin
wicked-pdf
verisign
openmrs
trust
ioctl
voronoi
myfaces
pack
decidable
fanotify
cfwheels
hmisc
unhandled
android-handler
clarion
thoughtworks-go
window-resize
iplimage
inputbox
multivariate-testing
berkeley-db-xml
object-code
lmax
oracle-adf-mobile
forio-contour
neo4jphp
jchartfx
roxy-fileman
eclim
xsd2code
frontbase
mp4parser
node.js-stream
objective-c-runtime
contextswitchdeadlock
user-forums
ip-geolocation
zend-pdf
image-formats
nsfont
quartz-core
office-automation
explicit
ccnet-config
downcasting
acceleration
remote-working
downloadfile
parentid

Resources

Encrypt Message