Copied to clipboard

Flag this post as spam?

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


  • Michael Beever 74 posts 155 karma points
    Dec 07, 2021 @ 10:44
    Michael Beever
    0

    Full Text Search Package

    Hello, I have installed the package and slowly building it up.

    I am so close to getting it to work but I cannot get the Summary to display the content I require yet I can see it in the search in the backend.

    var searchTerm = new Search(Request["query"])
                    .EnableHighlighting()
                    .SetPageLength(10)  
                    .AddSummaryProperty("pageContent")
                    .SetSummaryLength(400);
    

    Is the code I am using and what I would expect to see is....

    Twice a year we send a newsletter to all of our contributing and pensioner members of the Scheme.The newsletters cover various general topics such as health, finance and lifestyle as well as an update by a state benefits consultant who gives very useful information on changes to benefits such as the State Pension.We also use the newsletters to keep you informed about changes to the Local Government Pension Scheme. Outlook This is sent to our contributing members AtEase This is sent to members in receipt of their pension
    

    However what the page is displaying

    The newsletters cover various general topics such as health, finance and lifestyle as well as an update by a state benefits consultant who gives very useful information on changes to benefits such as the State Pension.We also use the newsletters to keep you informed about changes to the Local Government Pension Scheme.
    

    The code I am using to render the summary is

    @result.Summary
    

    I am confused and struggling to move on from here.

    Any advice would be appreciated.

    Thanks

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Dec 07, 2021 @ 11:12
    Søren Kottal
    0

    What's in your pageContent column? The summary is summarized around your search terms, so the content of the summary depends on what you are searching for.

  • Michael Beever 74 posts 155 karma points
    Dec 07, 2021 @ 11:14
    Michael Beever
    0

    I am searching for "Newsletter".

    This is what is in the pageContent.

    Twice a year we send a newsletter to all of our contributing and pensioner members of the Scheme.The newsletters cover various general topics such as health, finance and lifestyle as well as an update by a state benefits consultant who gives very useful information on changes to benefits such as the State Pension.We also use the newsletters to keep you informed about changes to the Local Government Pension Scheme. Outlook This is sent to our contributing members AtEase This is sent to members in receipt of their pension

    So you are saying because Newsletter does not appear in the first paragraph it removes it?

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Dec 07, 2021 @ 11:19
    Søren Kottal
    0

    Except it does appear in the first paragraph :)

    You can see what it does here: https://github.com/skttl/umbraco-fulltextsearch8/blob/v9/dev/src/Our.Umbraco.FullTextSearch/Helpers/Highlighter.cs (depending on which version you are on)

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Dec 07, 2021 @ 11:20
    Søren Kottal
    0

    Note, you can also just get the IPublishedContent of the found node by using @result.Content, from there you can get whatever value you need :)

  • Michael Beever 74 posts 155 karma points
    Dec 07, 2021 @ 11:20
    Michael Beever
    0

    Yes I had that working previously but found the highlight element does not work via this method.

  • Michael Beever 74 posts 155 karma points
    Dec 07, 2021 @ 14:13
    Michael Beever
    0

    Hi Søren,

    Still struggling but I do have a second question.

    I run two websites from the CMS with different domains. How can i separate the sites?

    Thanks

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Dec 07, 2021 @ 14:26
    Søren Kottal
    0

    You can specify a root node in your Search object

  • Michael Beever 74 posts 155 karma points
    Dec 07, 2021 @ 14:48
    Michael Beever
    0

    Hi Søren,

    Perfect thanks, think I have also sorted my first issue as well :)

    This is a fantastic tool.

Please Sign in or register to post replies

Write your reply to:

Draft