EdgeNGrams with Fuzzy not working perfect

I am using elastic and I am cuurently satisfied with my searches relevance except of one ocassion.For example If I am searching for the world "play" I will get docs containing wold "plays" with higher score than these ones with word "play".And that happens because I am using edgeNgrams(on indexing) with Fuzziness.Auto(on searching).Is there any filter or method to boost the exact ones than the fuzzy ones?

Here is code for indexing

var response = client.CreateIndex(index, s => s
.Settings(s1 => s1.NumberOfShards(1).NumberOfReplicas(1)
.Analysis(a => a.TokenFilters(t => t.EdgeNGram("edge", ed => ed.MaxGram(50).MinGram(1).Side(EdgeNGramSide.Front))
.Lowercase("lowercase", gl => gl.Language(Language.Greek.ToString())).KeywordMarker("keywords", gk => gk.Keywords("")))
.Analyzers(a1 => a1.Custom("forindex", t => t.Tokenizer("standard")
.Filters("edge", "lowercase", "keywords" ))
.Custom("forsearch", cu => cu.Tokenizer("standard")
.Filters("lowercase", "keywords"))))));

And here for searching

var query = new MatchQuery()
                            Query = searchWord,
                            Operator = Operator.And,
                            Field = fieldName,
                            Fuzziness = Fuzziness.Auto,
                            PrefixLength = 1,
                            Analyzer = "forsearch"

What version of Elasticsearch is it? All 5.x releases and recent 2.x releases are supposed to have https://issues.apache.org/jira/browse/LUCENE-329 in, which makes all expanded terms use the same index stats.

its 5.2

Could you share a recreation of this issue?

Sorry Adrien, I didn't catch it.What do you mean?

He meant a script like the example in:

I noticed that if I change edgeNGram side from Front to Back works fine, but I need an example on how edgeNGram back works.

Note that side has been deprecated and will be removed in the future.


Its not exaclty what I need, but than you for your important help!!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.