Skip to content

Instantly share code, notes, and snippets.

@ps-team
Created October 27, 2017 08:11
Show Gist options
  • Save ps-team/670afb3f5ca48a5058ff1a94ebe94e3f to your computer and use it in GitHub Desktop.
Save ps-team/670afb3f5ca48a5058ff1a94ebe94e3f to your computer and use it in GitHub Desktop.
Example of doing a weighted search with the WebApi
@using Contensis.Framework.Web
@using Contensis.Framework.Web.Search
@using System.Collections.ObjectModel
@{
IQuery pageQuery = Query.WhereFullTextContains("Contensis", In.Column("Property_Title", 100), In.Column("SC_Content", 10));
ReadOnlyCollection<ContentNode> pages = new NodeFinder().Find(pageQuery, selectCount:3);
}
<ul>
@foreach(ContentNode page in pages) {
<li>@page.Title</li>
}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment