Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy authored Oct 9, 2018
1 parent 4a0d377 commit 8a6b9d4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,60 +18,60 @@ To configure indexing there are static methods on the Our.Umbraco.Look.Services.
Eg.

using Our.Umbraco.Look.Services;

// return a string (or null)

LookIndexService.SetNameIndexer(publishedContent => {

if (publishedContent.DocumentTypeAlias == "myDocTypeAlias")
{
{
// return a string (or null)
return "my custom name for myDocTypeAlias to be indexed";
}

// fallback to default indexing (or can return null)
return LookIndexService.DefaultNameIndexer(publishedContent);
});

// return a string (or null)

LookIndexService.SetTextIndexer(publishedContent => {

if (publishedContent.DocumentTypeAlias == "myDocTypeAlias")
{
// return a string (or null)
return "my text for myDocTypeAlias to be indexed";
}

// fallback to default indexing (or can return null)
return LookIndexService.DefaultTextIndexer(publishedContent);
});

// return a string array (or null)

LookIndexService.SetTagIndexer(publishedContent => {

if (publishedContent.DocumentTypeAlias == "myDocTypeAlias")
{
// return a string array (or null)
return new string[] { "tag1", "tag2" };
}
// fallback to default indexing (or can return null)
return LookIndexService.DefaultTagIndexer(publishedContent);
});

// return a DateTime obj (or null)

LookIndexService.SetDateIndexer(publishedContent => {

if (publishedContent.DocumentTypeAlias == "myDocTypeAlias")
{
// return a DateTime obj (or null)
return new DateTime(2005, 02, 16);
}

// fallback to default indexing (or can return null)
return LookIndexService.DefaultDateIndexer(publishedContent);
});

// return an Our.Umbraco.Look.Models.Location obj (or null)

LookIndexService.SetLocationIndexer(publishedContent => {

if (publishedContent.DocumentTypeAlias == "myDocTypeAlias")
{
// return an Our.Umbraco.Look.Models.Location obj (or null)
return new Lcoation(55.406330, 10.388500);
}

Expand Down

0 comments on commit 8a6b9d4

Please sign in to comment.