Try our conversational search powered by Generative AI!

Unified Search Filter by a specific Property Value



I have implimented the serach page by taking reference from Aloy site. It is unified search result. Now I have to filter the current result by Property Values BrandName and PublishDate.

  1. Is it possible with the current Unified result?
  2. I have tried it by GetPagesResult, but by this Doucment URL and Excepert become empty in my serach result

Please suggect me asap.



Jun 02, 2017 12:34

Hello @Abhishek,

Take a look at these previous forum posts:

Forum post #1 - This post explains how to include properties into the index by creating an initialization module.

Forum post #2 - This post explains how to return the data that's included in the index.

Hope this helps!


Jun 02, 2017 17:32

Hi RJ,

Thanks for the reply. I doesn't got the hits after applying suggested solution.

First I have created the follwoing Extn method to refernce "BrandName" property.

public static IEnumerable<string> ReferenceBrands<T>(this T content)
var file = content as IContent;
//if (file != null)
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var references = contentRepository.GetReferencesToContent(file.ContentLink, false);
foreach (var referenceInformation in references)
PageData page = null;
contentRepository.TryGet(referenceInformation.OwnerID, out page);
if (page != null)
yield return page.GetPropertyValue("BrandName");


After that include it in index :   SearchClient.Instance.Conventions.ForInstancesOf<PageData>().IncludeField(x => x.ReferenceBrands());

Build Index.

Update by query as :

var queryFor = searchClient.UnifiedSearch().For(model.Query);

if (model.UseAndForMultipleSearchTerms)
queryFor = queryFor.WithAndAsDefaultOperator();

var query = queryFor
.TermsFacetFor(x => x.ReferenceBrands())
.FilterFacet("AllSections", x => x.ReferenceBrands().Exists())
.Skip((model.PagingPage - 1) * model.CurrentPage.PageSize)

PLease suggest.



Jun 02, 2017 22:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.