Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| -- Create a temporary table for all documents which are published and not in the recycle bin | |
| CREATE TABLE #Nodes (id int) | |
| -- Delete all rows if the table exists before | |
| TRUNCATE TABLE #Nodes | |
| -- Insert all nodeIds from all documents which are published and not in the recycle bin | |
| INSERT INTO #Nodes | |
| SELECT N.id | |
| FROM umbracoNode N | |
| INNER JOIN cmsDocument D ON N.ID = D.NodeId |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| <root> | |
| <affiliate refID="1200">1200</affiliate> | |
| <affiliate refID="1201">1201</affiliate> | |
| <affiliate refID="1202">1202</affiliate> | |
| <affiliate refID="1203">1203</affiliate> | |
| <affiliate refID="1204">1204</affiliate> | |
| <affiliate refID="1205">1205</affiliate> | |
| <affiliate refID="1206">1206</affiliate> | |
| <affiliate refID="1207">1207</affiliate> | |
| <affiliate refID="1208">1208</affiliate> |
| using System.Collections.Generic; | |
| using Examine; | |
| using umbraco.businesslogic; | |
| namespace MyApplication | |
| { | |
| public class ExamineIndexRebuild : ApplicationStartupHandler | |
| { |
We select the 1st stylesheet in a temporary nodeset created from the default stylesheet and the stylesheet referenced by the either the QueryString or a Cookie value.
Here's a commented version of the XPath that creates the $activeCSS variable:
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
| <%@ Master Language="C#" MasterPageFile="~/masterpages/BlankTemplate.master" AutoEventWireup="true" %> | |
| <script runat="server"> | |
| protected void Page_Load(object sender, EventArgs e) | |
| { | |
| var current = umbraco.NodeFactory.Node.GetCurrent(); | |
| if (current != null) | |
| { | |
| var child = current.ChildrenAsList.FirstOrDefault(); | |
| if (child != null) | |
| { |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!DOCTYPE xsl:stylesheet [ | |
| <!ENTITY nbsp " "> | |
| ]> | |
| <xsl:stylesheet | |
| version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:msxml="urn:schemas-microsoft-com:xslt" | |
| xmlns:umbraco.library="urn:umbraco.library" | |
| exclude-result-prefixes="msxml umbraco.library"> |