... var searcher = ExamineManager.Instance; var searchCriteria = searcher.CreateSearchCriteria(); var query = searchCriteria.GroupedOr(new[] { "nodeName", "name", "title", "bodyText", "eventDetails", "subtitle", "location", "newShortText", "newsLongText", "description", "seo" }, searchTerm).Compile(); var searchResults = searcher.Search(query).Where(r => r["__IndexType"] == "content").ToList() ...
However, I did not manage to find a way how to search the page textual content.
There is a property named Conent of type Grid TextPage which contains most of the textual content of the page. The problem that its data is stored in json format and contains also images and other html not relevant content.
I would like to retrieve the text only version of this Grid TextPage so I could also search within the page and not just the fields mentioned above (name , title, bodyText...)
Searching page content or Grid TextPage (Umbraco 7.2)
Hi there,
I've found an example for implementing search on Umbraco using this code
https://gist.github.com/carlosmartinezt/fba2e880f5c3e7d2cccd
...
var searcher = ExamineManager.Instance;
var searchCriteria = searcher.CreateSearchCriteria();
var query = searchCriteria.GroupedOr(new[] { "nodeName", "name", "title", "bodyText", "eventDetails", "subtitle", "location", "newShortText", "newsLongText", "description", "seo" }, searchTerm).Compile();
var searchResults = searcher.Search(query).Where(r => r["__IndexType"] == "content").ToList()
...
However, I did not manage to find a way how to search the page textual content.
There is a property named Conent of type Grid TextPage which contains most of the textual content of the page.
The problem that its data is stored in json format and contains also images and other html not relevant content.
I would like to retrieve the text only version of this Grid TextPage so I could also search within the page and not just the fields mentioned above (name , title, bodyText...)
Any idea ?
Hello,
This example might help: https://gist.github.com/abjerner/bdd89e0788d274ec5a33
Jeroen
is working on a reply...