Does anyone know how to get ezsearch to work with articulate blogs? Articulate is not the main node. I have a HomePage node and under that node I have various pages, including the articulate node.
EzSearch seems to work with most of the property types in my umbraco project, except Articulate property types.
Any ideas / help with this?
I don't know if this matters, but I commented out the following:
// ====================================================
// Comment the next if statement out if you want a root
// node id of -1 to search content across all sites
// and not just the current site.
// ====================================================
@if (model.RootContentNodeId <= 0)
{
model.RootContentNodeId = Model.Content.AncestorOrSelf(1).Id;
}@
I believe I did...I've removed them now, but in the past I used to have "richText" (from Articulate). I find it very strange because I cannot even search for the page that has the articulate node in the search (i.e. if I search "Articles" it will not show up...Articles is the articulate node name for me)
Thanks for the response. I notice that it now includes an articulate blog post in the results but there seem to be two issues (even after rebuilding the index):
(1) The search will only catch an articulate blog post and display it as a result if the title of the post is one word. If the title consists of multiple words, then it will only pick up that blog post if the first word of that phrase is searched, not the entire title. For example, blog post named: "This is a blog post" will only show up as a result in a search for "This", and not in a search for "This is a blog post" (exact match).
(2) The excerpt which is supposed to highlight the search term doesn't show up at all for any blog posts. This makes me think that the actual content of the blog post is not being searched (I have confirmed this with a simple test search for unique words within blog posts). Any idea as to how to include the blog post content within the search and display a small excerpt that highlights keywords when a blog post shows up as a result (similar to searching other pages of the site which is done by default in ezSearch)?
Nevertheless, your response is brilliant, and is much appreciated :)
Minor correction, Articulate Posts are not virtual nodes; I think only tags and categories are virtual.
The -template:0 criteria excludes any nodes that don't have a template so you could just remove that but then you'd get data/organisational/content blocks returned in search so probably better to add/amend OR clause as needed.
Unsure why your example Macro code has so many fields (numbered)?
You need to ensure that the SearchFields parameter includes the Articulate fields you want to search, e.g. markdown,richText,tags,categories,nodeName,umbracoUrlName,urlName. The order in which these are passed affects priority/boosting.
You can either pass these as macro parameters as your example; and/or modify the fallback parameters at the top of ezSearch.cshtml to include them.
For preview ensure your passing the main content fields to the PreviewFields parameter: PreviewFields = "richText" (or again modify the fallback)
Preview will only parse text / HTML out of the box; additional work is required to parse other field types like markdown or json (grid) - better to get content from index in these cases.
Phrase searches only work if you quote the phrase: "This is a blog post".
Use the back office Examine search tools to debug Search and see what Examine is storing in fields; if your running in debug mode and enable debug logging in log4net.config <priority value="Debug"/> then log file will record Lucene syntax which you can then copy/paste and tinker with in Search tools:
2017-07-05 12:33:43,507 [P19548/D15/T46] DEBUG System.String - [ezSearch] Searching Lucene with the following query: -umbracoNaviHide:1 -hideInSearch:1 -__NodeTypeAlias:image -__NodeTypeAlias:folder -__NodeTypeAlias:file +((__IndexType:content +searchPath:1083 (-template:0 OR (__NodeTypeAlias:newsPost __NodeTypeAlias:blogPost __NodeTypeAlias:articulateRichText __NodeTypeAlias:articulateMarkdown))) (__IndexType:media)) +(pageTitle:"this is a blog post" gridContent:"this is a blog post" text:"this is a blog post" markdown:"this is a blog post" richText:"this is a blog post" tags:"this is a blog post" metaData:"this is a blog post" bodyText:"this is a blog post" nodeName:"this is a blog post" umbracoUrlName:"this is a blog post" urlName:"this is a blog post" ) pageTitle:"this is a blog post"^11 gridContent:"this is a blog post"^10 text:"this is a blog post"^9 markdown:"this is a blog post"^8 richText:"this is a blog post"^7 tags:"this is a blog post"^6 metaData:"this is a blog post"^5 bodyText:"this is a blog post"^4 nodeName:"this is a blog post"^3 umbracoUrlName:"this is a blog post"^2 urlName:"this is a blog post"^1
Minor edit: add excerpt to SearchFields / PreviewFields if wanted.
The macro code has so many fields because the site is massive and has many different property aliases.
Good point re search field parameters...I forgot to add those in again to the macro code.
Here are the extra ones I added for Articulate for searchFields and previewFields: blogTitle, blogDescription, umbracoUrlName, markdown, richText, tags, categories, excerpt, searchUrlName, tagsPageName, categoriesPageName, tagsUrlName, categoriesUrlName.
I think modifying the macro code is a lot easier, thanks :)
Unfortunately, even when I quote the phrase, it doesn't return any value. Any idea on how to have the blog posts show up if part or all of their titles are searched. For example, "This is a blog post" will only show up as a result in a search for "This", and not even in a search for "This is" (partial match)...I find this so strange. I'm not really sure on how to fix this. I find that it only does this wonky phrase issue with articulate blog post titles and not anything else.
Thanks again, it's been 5 months that this has been lagging haha...I kind of just gave up.
ezSearch and Articulate
Hi,
Does anyone know how to get ezsearch to work with articulate blogs? Articulate is not the main node. I have a HomePage node and under that node I have various pages, including the articulate node.
EzSearch seems to work with most of the property types in my umbraco project, except Articulate property types.
Any ideas / help with this?
I don't know if this matters, but I commented out the following:
Hi Bobi
Did you include Articulate properties to the searchable properties?
Can you show how did you configure ezSearch?
Thanks,
Alex
Hi Alex,
Thanks for replying.
I believe I did...I've removed them now, but in the past I used to have "richText" (from Articulate). I find it very strange because I cannot even search for the page that has the articulate node in the search (i.e. if I search "Articles" it will not show up...Articles is the articulate node name for me)
Articulate posts are virtual nodes that don't have a template so could/can modify contentFilterPath around line 79 of ezSearch.cshtml:
Hi Gavin,
Thanks for the response. I notice that it now includes an articulate blog post in the results but there seem to be two issues (even after rebuilding the index):
(1) The search will only catch an articulate blog post and display it as a result if the title of the post is one word. If the title consists of multiple words, then it will only pick up that blog post if the first word of that phrase is searched, not the entire title. For example, blog post named: "This is a blog post" will only show up as a result in a search for "This", and not in a search for "This is a blog post" (exact match).
(2) The excerpt which is supposed to highlight the search term doesn't show up at all for any blog posts. This makes me think that the actual content of the blog post is not being searched (I have confirmed this with a simple test search for unique words within blog posts). Any idea as to how to include the blog post content within the search and display a small excerpt that highlights keywords when a blog post shows up as a result (similar to searching other pages of the site which is done by default in ezSearch)?
Nevertheless, your response is brilliant, and is much appreciated :)
Minor correction, Articulate Posts are not virtual nodes; I think only tags and categories are virtual.
The
-template:0
criteria excludes any nodes that don't have a template so you could just remove that but then you'd get data/organisational/content blocks returned in search so probably better to add/amend OR clause as needed.Unsure why your example Macro code has so many fields (numbered)?
You need to ensure that the SearchFields parameter includes the Articulate fields you want to search, e.g.
markdown,richText,tags,categories,nodeName,umbracoUrlName,urlName
. The order in which these are passed affects priority/boosting.You can either pass these as macro parameters as your example; and/or modify the fallback parameters at the top of ezSearch.cshtml to include them.
For preview ensure your passing the main content fields to the PreviewFields parameter:
PreviewFields = "richText"
(or again modify the fallback)Preview will only parse text / HTML out of the box; additional work is required to parse other field types like markdown or json (grid) - better to get content from index in these cases.
Phrase searches only work if you quote the phrase:
"This is a blog post"
.Use the back office Examine search tools to debug Search and see what Examine is storing in fields; if your running in debug mode and enable debug logging in log4net.config
<priority value="Debug"/>
then log file will record Lucene syntax which you can then copy/paste and tinker with in Search tools:2017-07-05 12:33:43,507 [P19548/D15/T46] DEBUG System.String - [ezSearch] Searching Lucene with the following query: -umbracoNaviHide:1 -hideInSearch:1 -__NodeTypeAlias:image -__NodeTypeAlias:folder -__NodeTypeAlias:file +((__IndexType:content +searchPath:1083 (-template:0 OR (__NodeTypeAlias:newsPost __NodeTypeAlias:blogPost __NodeTypeAlias:articulateRichText __NodeTypeAlias:articulateMarkdown))) (__IndexType:media)) +(pageTitle:"this is a blog post" gridContent:"this is a blog post" text:"this is a blog post" markdown:"this is a blog post" richText:"this is a blog post" tags:"this is a blog post" metaData:"this is a blog post" bodyText:"this is a blog post" nodeName:"this is a blog post" umbracoUrlName:"this is a blog post" urlName:"this is a blog post" ) pageTitle:"this is a blog post"^11 gridContent:"this is a blog post"^10 text:"this is a blog post"^9 markdown:"this is a blog post"^8 richText:"this is a blog post"^7 tags:"this is a blog post"^6 metaData:"this is a blog post"^5 bodyText:"this is a blog post"^4 nodeName:"this is a blog post"^3 umbracoUrlName:"this is a blog post"^2 urlName:"this is a blog post"^1
Minor edit: add
excerpt
to SearchFields / PreviewFields if wanted.The macro code has so many fields because the site is massive and has many different property aliases.
Good point re search field parameters...I forgot to add those in again to the macro code.
Here are the extra ones I added for Articulate for searchFields and previewFields:
blogTitle, blogDescription, umbracoUrlName, markdown, richText, tags, categories, excerpt, searchUrlName, tagsPageName, categoriesPageName, tagsUrlName, categoriesUrlName
.I think modifying the macro code is a lot easier, thanks :)
Unfortunately, even when I quote the phrase, it doesn't return any value. Any idea on how to have the blog posts show up if part or all of their titles are searched. For example, "This is a blog post" will only show up as a result in a search for "This", and not even in a search for "This is" (partial match)...I find this so strange. I'm not really sure on how to fix this. I find that it only does this wonky phrase issue with articulate blog post titles and not anything else.
Thanks again, it's been 5 months that this has been lagging haha...I kind of just gave up.
Likely related to default lucene stop words,.
https://our.umbraco.org/search?q=stop%20words&cat=forum
is working on a reply...