Question

I have added a custom field to s template called Search Summary. It shows up in the index with Luke. But It is not in the results data. How can I add it to the results data, so I can then bind it to my search results page.

Was it helpful?

Solution

To search across a custom field, you would need to add a custom IComputedIndexField

but if values shows up in the index with Luke then your field is indexed.

i think you can do that:

create a new class inherit from SearchResultItem, and add a new propertie to your class to get the value of your custom field example:

[IndexField("Name of the field in Luke")]
public string PropertieName{get;set;}

replace SearchResultItem in your Query by the Name of your new Class like this:

SearchContext.GetQueryable<MyNewClassName>().Where(x=>x.PropertieName==Value);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top