Hello There,
I am using ES 6.1.1 Tokenized Standard filter in C# with NEST Query in the following way.
client.CreateIndex(indexName, c => c
.Settings(s => s.NumberOfShards(1)
.Analysis(a => a
.CharFilters(cf => cf
.Mapping("programming_language", mca => mca
.Mappings(new[]
{
"c# => csharp",
"C# => Csharp"
})
)
)
.Analyzers(anc => anc
.Custom("Tokenized_Filter", ca => ca
.CharFilters("html_strip", "programming_language")
.Tokenizer("standard")
.Filters("standard", "lowercase", "stop")
)
)
)
)
For fetching data from elastic search, I am suing following Query:
q.ConstantScore(cs => cs.Filter(wc => wc.Field(f => f.Name.Suffix("Tokenized")).Value(directoryReqFltVm.Name ))).Boost(40))
when I search for Ex "XYZ Community", the tokenized filter search for "XYZ" and give the boost of 40, then search "Community" and gives an equal boost of 40
I want that It should give more priority to the first keyword than to second so that more relevant data should come up first in searching
Is there is any solution for this or i can write my own custom filter which should help me in achieving that
any help would be really appreciated.
thanks in advance
Regards
Shivam