Created
May 20, 2014 14:23
-
-
Save contensis/8da73c887f6990156226 to your computer and use it in GitHub Desktop.
Carry out a simple query with the Contensis Web API Search.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
<p>Simple Search</p> | |
@{ | |
// Standard properties are prefixed with 'Property_' | |
var query = Query.Where("Property_Title").Contains("news"); | |
// The NodeFinder.Find() method will by default search from the root of the site. | |
var nodes = new NodeFinder().Find(query); | |
} | |
<ul> | |
@foreach(var node in nodes) | |
{ | |
<li>@node.Title</li> | |
} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment