Hi everyone! ๐
I'm implementing a custom search component in Umbraco that searches pages (not documents) using Examine's ExternalIndex. However, I am unable to access the correct content field that contains the actual text of the page.
I need to:
1. Extract a text snippet from the search results where the search term appears.
2. Highlight the search term in that snippet.
3. Ensure Iโm using the correct field from ExternalIndex to retrieve the page content.
Currently, I am trying to access:
- "mainContent_en-us"
- "combinedField"
However, both are always null in my Razor view.
What I Have Tried:
- Checked Examine Management in Umbraco Backoffice to inspect indexed fields.
- Attempted to retrieve content from different fields.
- Used item.Value
("fieldName"), but it always returns null.
ExternalIndex Fields (Example):
When searching for the term "arbeitsalltag", here are some relevant fields from the index:
__NodeId 1650
__NodeTypeAlias USNPage
__Path -1,2260,1591,1606,1650
__Published y
combinedField icon-layout color-black y ... (includes full text)
mainContent_en-us 0 {"text":"","headingtag":""} {"text":"","headingtag":""} (seems empty)
nodeName 1.3 Vision Mission Leitbild
searchablePath -1 2260 1591 1606 1650
It seems that combinedField contains the text, but I can't access it via item.Value
("combinedField").
This is my current search implementation: