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

add edge-ngram elastic search example #582

Closed
wants to merge 1 commit into from

Conversation

equivalent
Copy link
Contributor

example of https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html

this is supper helpful to understand not only edge-ngrams, but how to actually define own analysis with elasticsearch-rails

example of https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html 

this is supper helpful to understand not only edge-ngrams, but how to actually define own `analysis` with elasticsearch-rails
@equivalent
Copy link
Contributor Author

tests are failing due to Make sure thatgem install mime-types-data -v '3.2016.0521'succeeds before nothing to do with the code change,

@equivalent
Copy link
Contributor Author

@karmi any feedback on this PR ?

@karmi karmi closed this in f8df53a Feb 11, 2017
@karmi
Copy link
Contributor

karmi commented Feb 11, 2017

Hi Tomas, apologies for this ridiculous delay; I haven't been able to find time to process patches and respond to questions in this repository for a long time.

I've re-worded the commit message a bit, and I've translated the analysis output you had in comments into code, using the "Indices Analyze" API, in hope that it will add some didactic value to people.

When I was considering the example just now, I was wondering if we should have exactly this as an example for "home-grown" autocomplete -- people should use the dedicated Completion Suggester for that if at all possible; there's a Ruby example in activerecord_mapping_completion.rb.

However, I think the example still has value, and it's actually good that it is feature-wise very similar to the "completion" example. I'm thinking about actually expanding it a little bit, maybe by adding a different ngram filter, which would allow "infix" (inside-the-words) searches.

@equivalent
Copy link
Contributor Author

Hi Karmi, no worries.

Yeah it's up to you really I've got this piece of code in my Gist so people can still find it if they need :)
So feel free to change it / close it/ rewrite it. During the time I was writing this for my employer I struggled to find similar example so had to come up with own one. So thought it would be helpful to have it here + it it's a good way to get feedback by a Pro on this topic.

čus

@karmi
Copy link
Contributor

karmi commented Feb 17, 2017

@equivalent, the patch has been merged in f8df53a :) Thanks again!

@equivalent
Copy link
Contributor Author

@karmi awesome !! :) thank you

@equivalent equivalent deleted the patch-1 branch February 21, 2017 16:57
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

Successfully merging this pull request may close these issues.

2 participants