Can't define a custom tokenizer #104
-
Hi, thanks for the package. I've been struggling for a while and the docs are not helping. I'm trying to use indexSettings to define a custom ngram tokenizer, but it will just ignore it. I'm making sure I delete the index before rebuilding it. Here are some of my attemps
None produced the expected result. Any help? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Does this from the demo help a bit? |
Beta Was this translation helpful? Give feedback.
-
If you use arrays for index settings instead of objects you have to make sure they return the correct format, which you can find out by diving into the objects that the demo uses, i.e. this part: return (new Analysis())
->addAnalyzer($synonymAnalyzer)
->addFilter($synonymFilter)
->build(); |
Beta Was this translation helpful? Give feedback.
-
I am also pretty sure that this won't do anything by the way: 'number_of_shards' => 2,
'number_of_replicas' => 1,
'max_ngram_diff' => 20, |
Beta Was this translation helpful? Give feedback.
-
@souljacker I also faced same problem, if you implement the Aliased Interface hopefully that will solve the problem |
Beta Was this translation helpful? Give feedback.
-
Can you explain more your solution, because I face this problem, and I don't find the solution for it. This is what I have so far
After rebuilding the index, it always returns 0 results, altough I have a bunch of records indexed. If it were working optimally, it would bring several results. I want to define a tokenizer because, for example, I have many products whose names start with "product." If I type just "pro" it should return the products with the name "product," but by default, it doesn't. Do you think defining an edge_ngram tokenizer will solve my problem? |
Beta Was this translation helpful? Give feedback.
@souljacker I also faced same problem, if you implement the Aliased Interface hopefully that will solve the problem