Match Exact Value of a Field and not be Included as a Subset in That Field, not more not less


(Maryam Abdullah) #1

Hi,

please, I really need some help!

I want to be able to boost results if the query happens to match the exact value of a field and not be included as a subset in that field. This field has 2 analyzers, the custom one and the standard one which acts a tokenizer only.
I use the multi-match query and the querystring, however I need to use the term query, but with the following setting, it's not working.

.Text(s => s
  .Name(n => n.Title)
  .Analyzer("ar_analyzer")
  .Fields(f => f.Text(t => t.Analyzer("ar_standard").Name("exact"))))

with the following setting:

.Settings(ss => ss
                    .Analysis(an => an
                        .TokenFilters(tf => tf
                            .Stop("arabic_stop", ts => ts
                                .StopWords("_arabic_"))
                            .KeywordMarker("ar_keywords", km => km.KeywordsPath(keywordsFile))
                            .Stemmer("arabic_stemmer", st => st
                                .Language("arabic"))
                        )
                        .Analyzers(ns => ns
                            .Custom("ar_analyzer", cm => cm
                                .Tokenizer("standard")
                                .Filters("arabic_stop", "ar_keywords", "arabic_normalization", "arabic_stemmer")
                            )
                            .Custom("ar_standard", cm => cm
                                .Tokenizer("standard")
                            ))
                    )

Any thoughts on how it's possible to do this?

Thank you.


(system) closed #2

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