-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Indexing media tags as a facet; showing raw value for incorrectly ind…
…exed date fields (#689)
- Loading branch information
Showing
5 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
32 changes: 32 additions & 0 deletions
32
Composite/Search/Crawling/DataFieldProcessors/MediaTagsDataFieldProcessor.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Composite.Core.Extensions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Composite.Search.Crawling.DataFieldProcessors | ||
{ | ||
class MediaTagsDataFieldProcessor : DefaultDataFieldProcessor | ||
{ | ||
public override string[] GetFacetValues(object value) | ||
{ | ||
var str = (string)value; | ||
var strList = str.Split(',').Select(s => s.Trim()).Where(s => !s.IsNullOrEmpty()).ToArray(); | ||
return strList; | ||
} | ||
|
||
public override DocumentFieldFacet GetDocumentFieldFacet(PropertyInfo propertyInfo) | ||
{ | ||
var result = base.GetDocumentFieldFacet(propertyInfo); | ||
|
||
result.FacetType = FacetType.MultipleValues; | ||
|
||
return result; | ||
} | ||
|
||
} | ||
|
||
} | ||
|
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