Hunspell dictionaries

i'm having an index 'main' where i'm having headings of a site.

my requirement is to search this index with some keywords/phrases .

Then to create a new index 'result' with the matches.

i'm using 'Hunspell'

i need

computer => computers
computers =>computer
drank=> drink/drunk

so,after the configuration of Hunspell i gave a word "print" to be searched inside main index which have "printed" in heading ,but it didn't produce any hits .

Hunspell setting ..

index: 'result',
body: { "analysis" : {
"analyzer" : {
"en" : {
"tokenizer" :"lowercase",
"filter" : [ "lowercase", "en_US" ]
"filter" : {
"en_US" : {
"type" : "hunspell",
"locale" : "en_US",
"dedup" : true

the same setting is given for the main index creation as well{
"index": 'main',
"type": 'index',
"body": {
"query": {
"bool": {
"should": [
{"match": {"heading": "print"}}
},function (error, response,status) {
if (error){
else {
// console.log();
"body": [
"_id":" "}},
{"body": hit._source }]}) })
} });

I will be grateful if you can provide some help..

is there any way to do this ???

Based on your description, it sounds like you are having trouble matching documents in your "main" index, which is unrelated to hunspell. You should first ensure your documents are structured as you expect. Try adding a single document, then doing your search on the heading field and making sure you find the doc.

Once you get that working, you should consider using the reindex api, which is specifically designed to allow searching on one index and indexing the results into another index.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.