c# - ElasticSearch Hitboosting -


im looking way perform sort of hitboosting on search results, results clicked more appears higher on list.

im thinking storing document in different index (ex. "click_statistics" everytime clicks on result, store new document _id of search result clicked field. seems suitable way of doing it, , helps me keep statistics when re-indexing main index. (if have other suggestions, please share)

but have no idea on how can combine count second index, , include sort of scoring based on count search.

one way in include field on each document contains number of clicks has had, , use function_score query field_value_factor function scores based on function of click number

public class mydocument {     public long clicks { get; set; }  }  var response = client.search<mydocument>(s => s     .query(q => q         .functionscore(fs => fs             .query(fq => fq                 // search query here                 .matchall()             )             .functions(fun => fun                 // boost factor of square root of click value                  // documents clicks greater 0                 .fieldvaluefactor(fvf => fvf                     .field(f => f.clicks)                     .filter(fi => fi                         .range(r => r                             .field(rf => rf.clicks)                             .greaterthan(0)                         )                     )                     .factor(1.5)                     .modifier(fieldvaluefactormodifier.squareroot)                 )             )             .scoremode(functionscoremode.multiply)         )     ) ); 

if you'd aggregate , analyze click statistics, it's idea store them in index.

depending on frequency of clicks, it's idea not update click counts on documents every time click happens; perhaps makes sense update them hourly, daily, weekly, in quiet time (if have one), etc. use click statistics index along terms aggregation on clicked document id field counts of clicks each document in chosen timeframe, use bulk api update clicked documents in search index.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -