DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB
Upgrading to the latest Examine build, making the codebase compile against it. Added fluent search API. God damn it's sexy [TFS Changeset #64891]
This commit is contained in:
BIN
foreign dlls/Examine.dll
Normal file
BIN
foreign dlls/Examine.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
foreign dlls/UmbracoExamine.dll
Normal file
BIN
foreign dlls/UmbracoExamine.dll
Normal file
Binary file not shown.
@@ -22,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
umbraco weekly.build = umbraco weekly.build
|
||||
umbraco.build = umbraco.build
|
||||
foreign dlls\umbraco.Linq.DTMetal.Engine.dll = foreign dlls\umbraco.Linq.DTMetal.Engine.dll
|
||||
foreign dlls\UmbracoExamine.Core.dll = foreign dlls\UmbracoExamine.Core.dll
|
||||
foreign dlls\UmbracoExamine.Providers.dll = foreign dlls\UmbracoExamine.Providers.dll
|
||||
foreign dlls\UrlRewritingNet.UrlRewriter.dll = foreign dlls\UrlRewritingNet.UrlRewriter.dll
|
||||
foreign dlls\VistaDB.NET20.dll = foreign dlls\VistaDB.NET20.dll
|
||||
EndProjectSection
|
||||
|
||||
@@ -7,6 +7,8 @@ using System.Xml.Linq;
|
||||
using umbraco.BusinessLogic;
|
||||
using System.Xml;
|
||||
using umbraco.presentation.preview;
|
||||
using Examine.Providers;
|
||||
using Examine;
|
||||
|
||||
namespace umbraco.presentation
|
||||
{
|
||||
@@ -185,7 +187,7 @@ namespace umbraco.presentation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base URL.
|
||||
/// Gets the base URL for the website
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual string GetBaseUrl()
|
||||
@@ -204,5 +206,17 @@ namespace umbraco.presentation
|
||||
return m_Server;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal search provider from Examine.
|
||||
/// </summary>
|
||||
/// <value>The internal search provider.</value>
|
||||
public virtual BaseSearchProvider InternalSearchProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
return ExamineManager.Instance.SearchProviderCollection["InternalSearch"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Examine, Version=0.9.0.0, Culture=en-AU, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\Examine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=0.83.1.0, Culture=neutral, PublicKeyToken=1b03e6acf1164f73">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
@@ -151,13 +155,9 @@
|
||||
<Reference Include="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="UmbracoExamine, Version=0.9.0.0, Culture=en-AU, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\UmbracoExamine.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine.Providers, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\UmbracoExamine.Providers.dll</HintPath>
|
||||
<HintPath>..\..\foreign dlls\UmbracoExamine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.60829.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -7,8 +7,9 @@ using System.Web.Services;
|
||||
using System.Web.Services.Protocols;
|
||||
using System.Xml.Linq;
|
||||
using System.Collections.Generic;
|
||||
using UmbracoExamine.Core;
|
||||
using UmbracoExamine;
|
||||
using System.Web.Script.Serialization;
|
||||
using Examine;
|
||||
|
||||
namespace umbraco.presentation.umbraco.Search
|
||||
{
|
||||
@@ -42,19 +43,23 @@ namespace umbraco.presentation.umbraco.Search
|
||||
}
|
||||
|
||||
//if it doesn't start with "*", then search only nodeName and nodeId
|
||||
var criteria = new SearchCriteria(txt
|
||||
, txt.StartsWith("*") ? new string[] { } : new string[] { "nodeName", "id" }
|
||||
, new string[] { }
|
||||
, false
|
||||
, UmbracoContext.Current.UmbracoUser.StartNodeId > 0 ? (int?)UmbracoContext.Current.UmbracoUser.StartNodeId : null
|
||||
, limit
|
||||
, indexType
|
||||
, false);
|
||||
|
||||
IEnumerable<SearchResult> results = ExamineManager.Instance
|
||||
.SearchProviderCollection["InternalSearch"]
|
||||
.Search(criteria);
|
||||
var internalSearcher = UmbracoContext.Current.InternalSearchProvider;
|
||||
var criteria = internalSearcher.CreateSearchCriteria(100, indexType);
|
||||
IEnumerable<SearchResult> results;
|
||||
if (txt.StartsWith("*"))
|
||||
{
|
||||
results = internalSearcher.Search("*", 100, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var operation = criteria.NodeName(txt);
|
||||
if (UmbracoContext.Current.UmbracoUser.StartNodeId > 0)
|
||||
{
|
||||
operation.Or().Id(UmbracoContext.Current.UmbracoUser.StartNodeId);
|
||||
}
|
||||
|
||||
results = internalSearcher.Search(operation.Compile());
|
||||
}
|
||||
|
||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||
context.Response.Write(js.Serialize(results));
|
||||
|
||||
@@ -3,8 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using UmbracoExamine.Core;
|
||||
using UmbracoExamine;
|
||||
using System.Xml;
|
||||
using Examine;
|
||||
|
||||
|
||||
|
||||
@@ -44,18 +45,23 @@ namespace umbraco.presentation.dialogs
|
||||
IndexType indexType = (IndexType)Enum.Parse(typeof(IndexType), app);
|
||||
|
||||
//if it doesn't start with "*", then search only nodeName and nodeId
|
||||
var criteria = new SearchCriteria(query
|
||||
, query.StartsWith("*") ? new string[] { } : new string[] { "nodeName", "id" }
|
||||
, new string[] { }
|
||||
, false
|
||||
, UmbracoContext.Current.UmbracoUser.StartNodeId > 0 ? (int?)UmbracoContext.Current.UmbracoUser.StartNodeId : null
|
||||
, 100
|
||||
, indexType
|
||||
, false);
|
||||
var internalSearcher = UmbracoContext.Current.InternalSearchProvider;
|
||||
var criteria = internalSearcher.CreateSearchCriteria(100, indexType);
|
||||
IEnumerable<SearchResult> results;
|
||||
if (query.StartsWith("*"))
|
||||
{
|
||||
results = internalSearcher.Search("*", 100, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var operation = criteria.NodeName(query);
|
||||
if (UmbracoContext.Current.UmbracoUser.StartNodeId > 0)
|
||||
{
|
||||
operation.Or().Id(UmbracoContext.Current.UmbracoUser.StartNodeId);
|
||||
}
|
||||
|
||||
var results = ExamineManager.Instance
|
||||
.SearchProviderCollection["InternalSearch"]
|
||||
.Search(criteria);
|
||||
results = internalSearcher.Search(operation.Compile());
|
||||
}
|
||||
|
||||
searchResult.XPathNavigator = ResultsAsXml(results).CreateNavigator();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,10 @@ using System.Diagnostics;
|
||||
using System.Web;
|
||||
using System.Web.Services;
|
||||
using System.Xml;
|
||||
using UmbracoExamine.Core;
|
||||
using UmbracoExamine;
|
||||
using System.Collections.Generic;
|
||||
using Examine;
|
||||
using umbraco.presentation;
|
||||
|
||||
|
||||
namespace umbraco
|
||||
@@ -137,16 +139,30 @@ namespace umbraco
|
||||
try
|
||||
{
|
||||
//if the query starts with "*" then query all fields
|
||||
var criteria = new SearchCriteria(Query
|
||||
, Query.StartsWith("*") ? new string[] { } : new string[] { "nodeName", "id" }
|
||||
, new string[] { }
|
||||
, false
|
||||
, StartNodeId > 0 ? (int?)StartNodeId : null
|
||||
, 20);
|
||||
var internalSearcher = UmbracoContext.Current.InternalSearchProvider;
|
||||
var criteria = internalSearcher.CreateSearchCriteria(20, IndexType.Content);
|
||||
IEnumerable<SearchResult> results;
|
||||
if (Query.StartsWith("*"))
|
||||
{
|
||||
results = internalSearcher.Search("*", 20, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var operation = criteria.NodeName(Query);
|
||||
if (StartNodeId > 0)
|
||||
{
|
||||
operation.Or().Id(StartNodeId);
|
||||
}
|
||||
|
||||
IEnumerable<SearchResult> results = ExamineManager.Instance
|
||||
.SearchProviderCollection["InternalSearch"]
|
||||
.Search(criteria);
|
||||
results = internalSearcher.Search(operation.Compile());
|
||||
}
|
||||
|
||||
//var criteria = new SearchCriteria(Query
|
||||
// , Query.StartsWith("*") ? new string[] { } : new string[] { "nodeName", "id" }
|
||||
// , new string[] { }
|
||||
// , false
|
||||
// , StartNodeId > 0 ? (int?)StartNodeId : null
|
||||
// , 20);
|
||||
|
||||
foreach (var r in results)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user