Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bobi 352 posts 956 karma points
    Mar 30, 2017 @ 18:07
    Bobi
    0

    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:

    // ==================================================== // 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; }@

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Apr 12, 2017 @ 21:05
    Alex Skrypnyk
    0

    Hi Bobi

    Did you include Articulate properties to the searchable properties?

    Can you show how did you configure ezSearch?

    Thanks,

    Alex

  • Bobi 352 posts 956 karma points
    Apr 13, 2017 @ 18:29
    Bobi
    0

    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)

    @Umbraco.RenderMacro("ezSearch", new {rootContentNodeId="1052", rootMediaNodeId="", indexType="BOTH", searchFields= "nodeName, metaTitle, metaDescription, metaKeywords, bodyText, textString1, textString2, textString3, textString4, textString5, textString6, textString7, textString8, textString9, textString10, textString11, textString12, textString13, textString14, textString15, textString16, textString17, textString18, textString19, textString20, textString21, textString22, textString23, textString24, textString25, textString26, textString27, textString28, textString29, textString30, textString31, textString32, textString33, textString34, textString35, textString36, textString37, textString38, textString39, textString40, textString41, textString42, textString43, textString44, textString45, textString46, textString47, textString48, textString49, textString50, textString51, textString52, textString53, textString54, textString55, textString56, textString57, textString58, textString59, textString60, textString61, textString62, textString63, textString64, textString65, textString66, textString67, textString68, textString69, textString70, textString71, textString72, textString73, textString74, textString75, textString76, textString77, textString78, textString79, textString80, richText1, richText2, richText3, richText4, richText5, richText6, richText7, richText8, richText9, richText10, richText11, richText12, richText13, richText14, richText15, richText16, richText17, richText18, richText19, richText20, richText21, richText22, richText23, richText24, richText25, richText26, richText27, richText28, richText29, richText30, richText31, richText32, richText33, richText34, richText35, richText36, richText37, richText38, richText39, richText40, richText41, richText42, richText43, richText44, richText45, richText46, richText47, richText48, richText49, richText50, richText51, richText52, richText53", previewFields= "nodeName, metaTitle, metaDescription, metaKeywords, bodyText, richText1, richText2, richText3, richText4, richText5, richText6, richText7, richText8, richText9, richText10, richText11, richText12, richText13, richText14, richText15, richText16, richText17, richText18, richText19, richText20, richText21, richText22, richText23, richText24, richText25, richText26, richText27, richText28, richText29, richText30, richText31, richText32, richText33, richText34, richText35, richText36, richText37, richText38, richText39, richText40, richText41, richText42, richText43, richText44, richText45, richText46, richText47, richText48, richText49, richText50, richText51, richText52, richText53, textString1, textString2, textString3, textString4, textString5, textString6, textString7, textString8, textString9, textString10, textString11, textString12, textString13, textString14, textString15, textString16, textString17, textString18, textString19, textString20, textString21, textString22, textString23, textString24, textString25, textString26, textString27, textString28, textString29, textString30, textString31, textString32, textString33, textString34, textString35, textString36, textString37, textString38, textString39, textString40, textString41, textString42, textString43, textString44, textString45, textString46, textString47, textString48, textString49, textString50, textString51, textString52, textString53, textString54, textString55, textString56, textString57, textString58, textString59, textString60, textString61, textString62, textString63, textString64, textString65, textString66, textString67, textString68, textString69, textString70, textString71, textString72, textString73, textString74, textString75, textString76, textString77, textString78, textString79, textString80", previewLength="381", pageSize="10", hideFromSearchField="", searchFormLocation="NONE"})

  • Gavin Faux 15 posts 158 karma points
    Jul 04, 2017 @ 11:35
    Gavin Faux
    100

    Articulate posts are virtual nodes that don't have a template so could/can modify contentFilterPath around line 79 of ezSearch.cshtml:

     // Set search path
    var contentPathFilter = model.RootContentNodeId > 0
        ? string.Format("__IndexType:{0} +searchPath:{1} (-template:0 OR (__NodeTypeAlias:articulateRichText _NodeTypeAlias:articulateMarkdown))", UmbracoExamine.IndexTypes.Content, model.RootContentNodeId)
        : string.Format("__IndexType:{0} (-template:0 OR (__NodeTypeAlias:articulateRichText __NodeTypeAlias:articulateMarkdown))", UmbracoExamine.IndexTypes.Content);
    
  • Bobi 352 posts 956 karma points
    Jul 04, 2017 @ 18:33
    Bobi
    0

    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 :)

  • Gavin Faux 15 posts 158 karma points
    Jul 05, 2017 @ 11:39
    Gavin Faux
    1

    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.

  • Bobi 352 posts 956 karma points
    Jul 05, 2017 @ 18:09
    Bobi
    0

    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.

  • Gavin Faux 15 posts 158 karma points
    Jul 07, 2017 @ 16:08
    Gavin Faux
    0

    Likely related to default lucene stop words,.

    https://our.umbraco.org/search?q=stop%20words&cat=forum

Please Sign in or register to post replies

Write your reply to:

Draft