sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

Index analysis

Open Mopster opened this issue 12 years ago • 1 comments

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/

Mopster avatar Jun 12 '13 11:06 Mopster

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.

polyfractal avatar Jun 12 '13 20:06 polyfractal