Moves remaining non-lucene stuff
This commit is contained in:
@@ -20,13 +20,7 @@ namespace Umbraco.Examine
|
||||
/// </summary>
|
||||
public static class ExamineExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Matches a culture iso name suffix
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// myFieldName_en-us will match the "en-us"
|
||||
/// </remarks>
|
||||
internal static readonly Regex CultureIsoCodeFieldNameMatchExpression = new Regex("^([_\\w]+)_([a-z]{2}-[a-z0-9]{2,4})$", RegexOptions.Compiled);
|
||||
|
||||
|
||||
private static bool _isConfigured = false;
|
||||
private static object _configuredInit = null;
|
||||
@@ -51,51 +45,6 @@ namespace Umbraco.Examine
|
||||
});
|
||||
}
|
||||
|
||||
//TODO: We need a public method here to just match a field name against CultureIsoCodeFieldNameMatchExpression
|
||||
|
||||
/// <summary>
|
||||
/// Returns all index fields that are culture specific (suffixed)
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetCultureFields(this IUmbracoIndex index, string culture)
|
||||
{
|
||||
var allFields = index.GetFields();
|
||||
// ReSharper disable once LoopCanBeConvertedToQuery
|
||||
foreach (var field in allFields)
|
||||
{
|
||||
var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
|
||||
if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
|
||||
yield return field;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all index fields that are culture specific (suffixed) or invariant
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetCultureAndInvariantFields(this IUmbracoIndex index, string culture)
|
||||
{
|
||||
var allFields = index.GetFields();
|
||||
// ReSharper disable once LoopCanBeConvertedToQuery
|
||||
foreach (var field in allFields)
|
||||
{
|
||||
var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
|
||||
if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
|
||||
{
|
||||
yield return field; //matches this culture field
|
||||
}
|
||||
else if (!match.Success)
|
||||
{
|
||||
yield return field; //matches no culture field (invariant)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool TryParseLuceneQuery(string query)
|
||||
{
|
||||
// TODO: I'd assume there would be a more strict way to parse the query but not that i can find yet, for now we'll
|
||||
@@ -106,7 +55,7 @@ namespace Umbraco.Examine
|
||||
try
|
||||
{
|
||||
//This will pass with a plain old string without any fields, need to figure out a way to have it properly parse
|
||||
var parsed = new QueryParser(Version.LUCENE_30, "nodeName", new KeywordAnalyzer()).Parse(query);
|
||||
var parsed = new QueryParser(Version.LUCENE_30, UmbracoExamineFieldNames.NodeNameFieldName, new KeywordAnalyzer()).Parse(query);
|
||||
return true;
|
||||
}
|
||||
catch (ParseException)
|
||||
|
||||
@@ -66,21 +66,15 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ContentValueSetBuilder.cs" />
|
||||
<Compile Include="ExamineExtensions.cs" />
|
||||
<Compile Include="UmbracoIndexConfig.cs" />
|
||||
<Compile Include="LuceneIndexDiagnostics.cs" />
|
||||
<Compile Include="MediaValueSetBuilder.cs" />
|
||||
<Compile Include="PublishedContentIndexPopulator.cs" />
|
||||
<Compile Include="UmbracoExamineExtensions.cs" />
|
||||
<Compile Include="NoPrefixSimpleFsLockFactory.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UmbracoContentIndex.cs" />
|
||||
<Compile Include="ContentValueSetValidator.cs" />
|
||||
<Compile Include="UmbracoExamineIndexDiagnostics.cs" />
|
||||
<Compile Include="UmbracoExamineIndex.cs" />
|
||||
<Compile Include="LuceneIndexCreator.cs" />
|
||||
<Compile Include="UmbracoFieldDefinitionCollection.cs" />
|
||||
<Compile Include="UmbracoMemberIndex.cs" />
|
||||
<Compile Include="..\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
|
||||
@@ -6,71 +6,7 @@ namespace Umbraco.Examine
|
||||
{
|
||||
public static class UmbracoExamineExtensions
|
||||
{
|
||||
public static IBooleanOperation Id(this IQuery query, int id)
|
||||
{
|
||||
var fieldQuery = query.Id(id.ToInvariantString());
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on parent id
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation ParentId(this IQuery query, int id)
|
||||
{
|
||||
var fieldQuery = query.Field("parentID", id);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node name
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeName"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeName(this IQuery query, string nodeName)
|
||||
{
|
||||
var fieldQuery = query.Field("nodeName", (IExamineValue)new ExamineValue(Examineness.Explicit, nodeName));
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node name
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeName"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeName(this IQuery query, IExamineValue nodeName)
|
||||
{
|
||||
var fieldQuery = query.Field("nodeName", nodeName);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node type alias
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeTypeAlias"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeTypeAlias(this IQuery query, string nodeTypeAlias)
|
||||
{
|
||||
var fieldQuery = query.Field("__NodeTypeAlias", (IExamineValue)new ExamineValue(Examineness.Explicit, nodeTypeAlias));
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node type alias
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeTypeAlias"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeTypeAlias(this IQuery query, IExamineValue nodeTypeAlias)
|
||||
{
|
||||
var fieldQuery = query.Field("__NodeTypeAlias", nodeTypeAlias);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Umbraco.Examine
|
||||
{"sortOrder", new object[] {c.SortOrder}},
|
||||
{"createDate", new object[] {c.CreateDate}}, //Always add invariant createDate
|
||||
{"updateDate", new object[] {c.UpdateDate}}, //Always add invariant updateDate
|
||||
{"nodeName", (PublishedValuesOnly //Always add invariant nodeName
|
||||
{UmbracoExamineFieldNames.NodeNameFieldName, (PublishedValuesOnly //Always add invariant nodeName
|
||||
? c.PublishName?.Yield()
|
||||
: c.Name?.Yield()) ?? Enumerable.Empty<string>()},
|
||||
{"urlName", urlValue?.Yield() ?? Enumerable.Empty<string>()}, //Always add invariant urlName
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Examine;
|
||||
using Examine.LuceneEngine.Providers;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
@@ -2,7 +2,6 @@
|
||||
using Examine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
@@ -10,6 +9,7 @@ using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors.ValueConverters;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Core.Serialization;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
{
|
||||
@@ -19,16 +19,18 @@ namespace Umbraco.Examine
|
||||
private readonly IUserService _userService;
|
||||
private readonly ILogger _logger;
|
||||
private readonly IShortStringHelper _shortStringHelper;
|
||||
private readonly IJsonSerializer _serializer;
|
||||
|
||||
public MediaValueSetBuilder(PropertyEditorCollection propertyEditors,
|
||||
UrlSegmentProviderCollection urlSegmentProviders,
|
||||
IUserService userService, ILogger logger, IShortStringHelper shortStringHelper)
|
||||
IUserService userService, ILogger logger, IShortStringHelper shortStringHelper, IJsonSerializer serializer)
|
||||
: base(propertyEditors, false)
|
||||
{
|
||||
_urlSegmentProviders = urlSegmentProviders;
|
||||
_userService = userService;
|
||||
_logger = logger;
|
||||
_shortStringHelper = shortStringHelper;
|
||||
_serializer = serializer;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -48,7 +50,7 @@ namespace Umbraco.Examine
|
||||
ImageCropperValue cropper = null;
|
||||
try
|
||||
{
|
||||
cropper = JsonConvert.DeserializeObject<ImageCropperValue>(
|
||||
cropper = _serializer.Deserialize<ImageCropperValue>(
|
||||
m.GetValue<string>(Constants.Conventions.Media.File));
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -84,7 +86,7 @@ namespace Umbraco.Examine
|
||||
{"sortOrder", new object[] {m.SortOrder}},
|
||||
{"createDate", new object[] {m.CreateDate}},
|
||||
{"updateDate", new object[] {m.UpdateDate}},
|
||||
{"nodeName", m.Name?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{UmbracoExamineFieldNames.NodeNameFieldName, m.Name?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{"urlName", urlValue?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{"path", m.Path?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{"nodeType", m.ContentType.Id.ToString().Yield() },
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Examine
|
||||
{"sortOrder", new object[] {m.SortOrder}},
|
||||
{"createDate", new object[] {m.CreateDate}},
|
||||
{"updateDate", new object[] {m.UpdateDate}},
|
||||
{"nodeName", m.Name?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{UmbracoExamineFieldNames.NodeNameFieldName, m.Name?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{"path", m.Path?.Yield() ?? Enumerable.Empty<string>()},
|
||||
{"nodeType", m.ContentType.Id.ToString().Yield() },
|
||||
{"loginName", m.Username?.Yield() ?? Enumerable.Empty<string>()},
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Umbraco.Examine
|
||||
/// <summary>
|
||||
/// By default these are the member fields we index
|
||||
/// </summary>
|
||||
public static readonly string[] DefaultMemberIndexFields = { "id", "nodeName", "updateDate", "loginName", "email", UmbracoExamineFieldNames.NodeKeyFieldName };
|
||||
public static readonly string[] DefaultMemberIndexFields = { "id", UmbracoExamineFieldNames.NodeNameFieldName, "updateDate", "loginName", "email", UmbracoExamineFieldNames.NodeKeyFieldName };
|
||||
|
||||
private static readonly IEnumerable<string> ValidCategories = new[] { IndexTypes.Member };
|
||||
protected override IEnumerable<string> ValidIndexCategories => ValidCategories;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<AssemblyName>Umbraco.Examine2</AssemblyName>
|
||||
<RootNamespace>Umbraco.Examine</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
133
src/Umbraco.Examine2/UmbracoExamineExtensions.cs
Normal file
133
src/Umbraco.Examine2/UmbracoExamineExtensions.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using Examine;
|
||||
using Examine.Search;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Examine
|
||||
{
|
||||
public static class UmbracoExamineExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Matches a culture iso name suffix
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// myFieldName_en-us will match the "en-us"
|
||||
/// </remarks>
|
||||
internal static readonly Regex CultureIsoCodeFieldNameMatchExpression = new Regex("^([_\\w]+)_([a-z]{2}-[a-z0-9]{2,4})$", RegexOptions.Compiled);
|
||||
|
||||
|
||||
|
||||
//TODO: We need a public method here to just match a field name against CultureIsoCodeFieldNameMatchExpression
|
||||
|
||||
/// <summary>
|
||||
/// Returns all index fields that are culture specific (suffixed)
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetCultureFields(this IUmbracoIndex index, string culture)
|
||||
{
|
||||
var allFields = index.GetFields();
|
||||
// ReSharper disable once LoopCanBeConvertedToQuery
|
||||
foreach (var field in allFields)
|
||||
{
|
||||
var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
|
||||
if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
|
||||
yield return field;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all index fields that are culture specific (suffixed) or invariant
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetCultureAndInvariantFields(this IUmbracoIndex index, string culture)
|
||||
{
|
||||
var allFields = index.GetFields();
|
||||
// ReSharper disable once LoopCanBeConvertedToQuery
|
||||
foreach (var field in allFields)
|
||||
{
|
||||
var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
|
||||
if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
|
||||
{
|
||||
yield return field; //matches this culture field
|
||||
}
|
||||
else if (!match.Success)
|
||||
{
|
||||
yield return field; //matches no culture field (invariant)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static IBooleanOperation Id(this IQuery query, int id)
|
||||
{
|
||||
var fieldQuery = query.Id(id.ToInvariantString());
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on parent id
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation ParentId(this IQuery query, int id)
|
||||
{
|
||||
var fieldQuery = query.Field("parentID", id);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node name
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeName"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeName(this IQuery query, string nodeName)
|
||||
{
|
||||
var fieldQuery = query.Field(UmbracoExamineFieldNames.NodeNameFieldName, (IExamineValue)new ExamineValue(Examineness.Explicit, nodeName));
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node name
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeName"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeName(this IQuery query, IExamineValue nodeName)
|
||||
{
|
||||
var fieldQuery = query.Field(UmbracoExamineFieldNames.NodeNameFieldName, nodeName);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node type alias
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeTypeAlias"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeTypeAlias(this IQuery query, string nodeTypeAlias)
|
||||
{
|
||||
var fieldQuery = query.Field(ExamineFieldNames.ItemTypeFieldName, (IExamineValue)new ExamineValue(Examineness.Explicit, nodeTypeAlias));
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query method to search on node type alias
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="nodeTypeAlias"></param>
|
||||
/// <returns></returns>
|
||||
public static IBooleanOperation NodeTypeAlias(this IQuery query, IExamineValue nodeTypeAlias)
|
||||
{
|
||||
var fieldQuery = query.Field(ExamineFieldNames.ItemTypeFieldName, nodeTypeAlias);
|
||||
return fieldQuery;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,5 +19,7 @@ namespace Umbraco.Examine
|
||||
public const string RawFieldPrefix = ExamineFieldNames.SpecialFieldPrefix + "Raw_";
|
||||
|
||||
public const string VariesByCultureFieldName = ExamineFieldNames.SpecialFieldPrefix + "VariesByCulture";
|
||||
|
||||
public const string NodeNameFieldName = "nodeName";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Examine
|
||||
if (!fieldName.Contains("_") || !fieldName.Contains("-"))
|
||||
return false;
|
||||
|
||||
var match = ExamineExtensions.CultureIsoCodeFieldNameMatchExpression.Match(fieldName);
|
||||
var match = UmbracoExamineExtensions.CultureIsoCodeFieldNameMatchExpression.Match(fieldName);
|
||||
if (match.Success && match.Groups.Count == 3)
|
||||
{
|
||||
var nonCultureFieldName = match.Groups[1].Value;
|
||||
@@ -23,6 +23,7 @@ using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Core.Serialization;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Core.Sync;
|
||||
@@ -89,6 +90,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
}
|
||||
|
||||
public static IShortStringHelper ShortStringHelper { get; } = new DefaultShortStringHelper(new DefaultShortStringHelperConfig());
|
||||
public static IJsonSerializer JsonSerializer { get; } = new JsonNetSerializer();
|
||||
public static IVariationContextAccessor VariationContextAccessor { get; } = new TestVariationContextAccessor();
|
||||
public static IDbProviderFactoryCreator DbProviderFactoryCreator { get; } = new UmbracoDbProviderFactoryCreator(Constants.DbProviderNames.SqlCe);
|
||||
public static IBulkSqlInsertProvider BulkSqlInsertProvider { get; } = new SqlCeBulkSqlInsertProvider();
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
|
||||
public static MediaIndexPopulator GetMediaIndexRebuilder(PropertyEditorCollection propertyEditors, IMediaService mediaService)
|
||||
{
|
||||
var mediaValueSetBuilder = new MediaValueSetBuilder(propertyEditors, new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(TestHelper.ShortStringHelper) }), GetMockUserService(), GetMockLogger(), TestHelper.ShortStringHelper);
|
||||
var mediaValueSetBuilder = new MediaValueSetBuilder(propertyEditors, new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(TestHelper.ShortStringHelper) }), GetMockUserService(), GetMockLogger(), TestHelper.ShortStringHelper, TestHelper.JsonSerializer);
|
||||
var mediaIndexDataSource = new MediaIndexPopulator(null, mediaService, mediaValueSetBuilder);
|
||||
return mediaIndexDataSource;
|
||||
}
|
||||
@@ -68,8 +68,8 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
m.SortOrder == (int)x.Attribute("sortOrder") &&
|
||||
m.CreateDate == (DateTime)x.Attribute("createDate") &&
|
||||
m.UpdateDate == (DateTime)x.Attribute("updateDate") &&
|
||||
m.Name == (string)x.Attribute("nodeName") &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute("nodeName") &&
|
||||
m.Name == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.Path == (string)x.Attribute("path") &&
|
||||
m.Properties == new PropertyCollection() &&
|
||||
m.ContentType == Mock.Of<ISimpleContentType>(mt =>
|
||||
@@ -108,8 +108,8 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
m.SortOrder == (int)x.Attribute("sortOrder") &&
|
||||
m.CreateDate == (DateTime)x.Attribute("createDate") &&
|
||||
m.UpdateDate == (DateTime)x.Attribute("updateDate") &&
|
||||
m.Name == (string)x.Attribute("nodeName") &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute("nodeName") &&
|
||||
m.Name == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.Path == (string)x.Attribute("path") &&
|
||||
m.Properties == new PropertyCollection() &&
|
||||
m.ContentType == Mock.Of<ISimpleContentType>(mt =>
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace Umbraco.Tests.UmbracoExamine
|
||||
m.SortOrder == (int)x.Attribute("sortOrder") &&
|
||||
m.CreateDate == (DateTime)x.Attribute("createDate") &&
|
||||
m.UpdateDate == (DateTime)x.Attribute("updateDate") &&
|
||||
m.Name == (string)x.Attribute("nodeName") &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute("nodeName") &&
|
||||
m.Name == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.GetCultureName(It.IsAny<string>()) == (string)x.Attribute(UmbracoExamineFieldNames.NodeNameFieldName) &&
|
||||
m.Path == (string)x.Attribute("path") &&
|
||||
m.Properties == new PropertyCollection() &&
|
||||
m.Published == true &&
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Web.Editors
|
||||
if (!msg.IsSuccessStatusCode)
|
||||
throw new HttpResponseException(msg);
|
||||
|
||||
var results = Examine.ExamineExtensions.TryParseLuceneQuery(query)
|
||||
var results = global::Umbraco.Examine.ExamineExtensions.TryParseLuceneQuery(query)
|
||||
? searcher.CreateQuery().NativeQuery(query).Execute(maxResults: pageSize * (pageIndex + 1))
|
||||
: searcher.Search(query, maxResults: pageSize * (pageIndex + 1));
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
? source.Values[UmbracoExamineFieldNames.IconFieldName]
|
||||
: Constants.Icons.DefaultIcon;
|
||||
|
||||
target.Name = source.Values.ContainsKey("nodeName") ? source.Values["nodeName"] : "[no name]";
|
||||
target.Name = source.Values.ContainsKey(UmbracoExamineFieldNames.NodeNameFieldName) ? source.Values[UmbracoExamineFieldNames.NodeNameFieldName] : "[no name]";
|
||||
|
||||
if (source.Values.TryGetValue(UmbracoExamineFieldNames.UmbracoFileFieldName, out var umbracoFile))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user