I am using a php library of elasticsearch to index and find documents in my website. This is the code for creating the index:
curl -XPUT \'http://localhost:9200/
The default elascticsearch analyzer doesn't do stemming and this is what you need to handle plural/singular. You can try using Snowball Analyzer for your text fields to see if it works better for your use case:
curl -XPUT 'http://localhost:9200/test' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
}
},
"mappings" : {
"page" : {
"properties" : {
"mytextfield": { "type": "string", "analyzer": "snowball", "store": "yes"}
}
}
}
}'