Custom Tokenizer Not Seeing Setting


(Ralph LeVan) #1

I've finally gotten my tokenizer written, installed and working. But, it doesn't seem to be getting my settings. I have an analyzer using my tokenizer defined like this:

PUT /test
{
    "settings": {
        "index": {
            "analysis": {
                "analyzer": {
                    "LCCN": {
                        "tokenizer": "LCCNTokenizer",
                        "canonical": true,
                        "filter": "lowercase"
                    }
                }
            }
        }
    }
}

When my TokenizerFactory gets called, all I see in the settings object is "index.version.created=2010099". IndexSettings is full of all sorts of stuff, including "index.analysis.analyzer.LCCN.canonical=true", but there's no way my code would know to look there.

Have I put my parameter in the wrong place or is there someplace else I should be looking for that configuration information?

Thanks!


(Ralph LeVan) #2

Yes, I see now that the parameters for a tokenizer need to be bundled up with the tokenizer in a new tokenizer definition.

PUT /test
{
    "settings": {
        "index": {
            "analysis": {
                "analyzer": {
                    "LCCN": {
                        "tokenizer": "lccn",
                        "filter": "lowercase"
                    }
                },
                "tokenizer": {
                    "lccn": {
                        "type": "LCCNTokenizer",
                        "canonical": true
                    }
                }
            }
        }
    }
}

Thanks for you patience!

Ralph


(system) #3