diff --git a/src/Umbraco.Examine/HtmlValueType.cs b/src/Umbraco.Examine/HtmlValueType.cs
deleted file mode 100644
index f55023f053..0000000000
--- a/src/Umbraco.Examine/HtmlValueType.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using Lucene.Net.Documents;
-using Umbraco.Core;
-using Examine.LuceneEngine.Indexing;
-using Umbraco.Core.Xml;
-
-namespace Umbraco.Examine
-{
- ///
- /// Strips HTML symbols from the text
- ///
- public class HtmlValueType : FullTextType
- {
- private readonly bool _storeRawValue;
-
- public HtmlValueType(string fieldName, bool storeRawValue) : base(fieldName, false)
- {
- _storeRawValue = storeRawValue;
- }
-
- protected override void AddSingleValue(Document doc, object value)
- {
- if (TryConvert(value, out var str))
- {
- if (XmlHelper.CouldItBeXml(str))
- {
- base.AddSingleValue(doc, str.StripHtml());
-
- if (_storeRawValue)
- {
- doc.Add(new Field(UmbracoExamineIndexer.RawFieldPrefix + FieldName, str,
- Field.Store.YES,
- Field.Index.NO,
- Field.TermVector.NO));
- }
- }
- else
- base.AddSingleValue(doc, str);
- }
- else
- base.AddSingleValue(doc, str);
- }
- }
-}
diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj
index 50561f7d8f..c7dad0cb15 100644
--- a/src/Umbraco.Examine/Umbraco.Examine.csproj
+++ b/src/Umbraco.Examine/Umbraco.Examine.csproj
@@ -59,7 +59,6 @@
-
diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
index 0b091e0d47..2bd3b3e9e0 100644
--- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
@@ -6,6 +6,7 @@ using Umbraco.Core.Macros;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Examine;
using Umbraco.Web.Macros;
namespace Umbraco.Web.PropertyEditors
@@ -31,6 +32,7 @@ namespace Umbraco.Web.PropertyEditors
protected override IConfigurationEditor CreateConfigurationEditor() => new RichTextConfigurationEditor();
+ public override IValueIndexer ValueIndexer => new RichTextValueIndexer();
///
/// A custom value editor to ensure that macro syntax is parsed when being persisted and formatted correctly for display in the editor
@@ -90,6 +92,21 @@ namespace Umbraco.Web.PropertyEditors
return parsed;
}
}
+
+ internal class RichTextValueIndexer : IValueIndexer
+ {
+ public IEnumerable> GetIndexValues(Property property, string culture)
+ {
+ var val = property.GetValue(culture);
+
+ if (!(val is string strVal)) yield break;
+
+ //index the stripped html values
+ yield return new KeyValuePair(property.Alias, new[] { strVal.StripHtml() });
+ //store the raw value
+ yield return new KeyValuePair($"{UmbracoExamineIndexer.RawFieldPrefix}{property.Alias}", new[] { strVal });
+ }
+ }
}