Skip to content

Instantly share code, notes, and snippets.

View francoislg's full-sized avatar

Francois Lachance-Guillemette francoislg

View GitHub Profile
@francoislg
francoislg / SpecificItemCondition.cs
Created July 25, 2018 13:44
Implementation of "SpecificItemCondition<T>" in Coveo for Sitecore Hive
public class SpecificItemCondition<T> : WhenCondition<T>, ICoveoCondition<T>
where T : RuleContext
{
private readonly IQueryNodeBuilder m_NodeBuilder;
private readonly ILocalizedStringFetcher m_LocalizedStringFetcher;
public ID ItemId { get; set; }
public SpecificItemCondition () : this (StaticServiceRegistrer.GetService<IQueryNodeBuilder> (),
StaticServiceRegistrer.GetService<ILocalizedStringFetcher> ()) { }
  • General
    • Sonar
    • Functional Tests
  • UI / Command Center
    • Legacy
    • Hive
    • IE11
  • Indexing
    • Impact Performance
  • On Prem
@francoislg
francoislg / RecentKeywords.js
Created May 25, 2018 13:04
Implementation of a simple "Recent keywords" component for the Coveo JavaScript Search Framework
var RecentKeywords = (function (_super) {
function RecentKeywords(element, options, bindings) {
this.type = 'RecentKeywords';
Coveo.Component.bindComponentToElement(element, this);
this.element = element;
this.options = options;
this.bindings = bindings;
this.rootElement = Coveo.$$(this.bindings.root);
this.rootElement.on(Coveo.QueryEvents.querySuccess, (event) => this.handleQuerySuccess(event));
this.keywords = [];
@francoislg
francoislg / CoveoFeelingLucky.css
Created November 28, 2017 15:53
CoveoFeelingLucky CSS
.hiddenFeelingLucky {
visibility: hidden;
}
.CoveoFeelingLucky {
cursor:pointer;
position:relative;
float:right;
z-index: 2;
color: #768396;
@francoislg
francoislg / CoveoFeelingLucky.ts
Last active November 28, 2017 18:31
CoveoFeelingLucky
import {
Component,
ComponentOptions,
IComponentBindings,
$$,
QueryEvents,
IDoneBuildingQueryEventArgs,
IBuildingQueryEventArgs,
IRankingFunction,
IFieldOption,
@francoislg
francoislg / CoveoTabCount.js
Created September 8, 2017 20:46
Coveo JavaScript Search Framework extension to add Tab count
Coveo.activateTabCount = (function(searchInterfaceElement, onTabCountResolved) {
var searchInterfaceDom = Coveo.$$(searchInterfaceElement);
var tabGroupBys = [];
searchInterfaceDom.on(Coveo.QueryEvents.doneBuildingQuery, function(event, args) {
tabGroupBys = [];
var allTabs = searchInterfaceDom.findAll(".CoveoTab").map(function(tabDom) {
return Coveo.get(tabDom, Coveo.Tab);
});
var allTabsExpressions = allTabs.map(function(tab) {
return tab.options.expression;