sherlock
sherlock copied to clipboard
Index analysis
Is there currently a way to define custom analyzers with Sherlock ? Or multiple analyzer for a field ?
For example, I want my content field to be run through several tokenizer and filters : Dutch stemming, whitespace, ... and nGram.
I could create a custom analyzer containing those, or I could maybe add them to the field mapping. I'm also using the analyzer field, so that has to work too. :-)
$index->mappings(
Sherlock::mappingBuilder($this->indexType)->Analyzer()->path("contentanalyzer"),
Sherlock::mappingBuilder($this->indexType)->String()->field('content')->analyzer('contentanalyzer'),
Sherlock::mappingBuilder($this->indexType)->String()->field('content')->analyzer('nGram')->minGram(2)->maxGram(10)
);
source : http://blog.avisi.nl/2012/02/22/searching-parts-of-words-with-elasticsearch/
Hmm, no, I don't think you can current do either custom analyzers or multi-field mapping. Let me dig into it tonight and see if I can add it.