Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index analysis #61

Open
Mopster opened this issue Jun 12, 2013 · 1 comment
Open

Index analysis #61

Mopster opened this issue Jun 12, 2013 · 1 comment

Comments

@Mopster
Copy link
Contributor

Mopster commented Jun 12, 2013

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/

@polyfractal
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants