문제

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.

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top