Copied to clipboard

Flag this post as spam?

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


  • Kieron 103 posts 278 karma points
    Oct 04, 2018 @ 07:51
    Kieron
    0

    Should ezSearch work with tags?

    Hi guys simply put, can ezSearch search tags also in a document? Just the standard Umbraco ones nothing fancy, currently not seeing that it is.

    Thanks

  • Ismail Mayat 4200 posts 8813 karma points MVP admin c-trib
    Oct 04, 2018 @ 11:08
    Ismail Mayat
    1

    Kieron,

    The tags are stored as csv list you will need to inject them in so search on them see https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/89730-multi-value-index-search-on-tag-field

    some code that uses document writing event to inject in umbraco tag data so that it is then searchable.

    Regards

    Ismail

  • Kieron 103 posts 278 karma points
    Oct 04, 2018 @ 11:30
    Kieron
    0

    Ok, I will have a look into that. Thank you.

    Theoretically could I use ezsearch to also do a tag only search? Currently I've been using it by POST'ing to /search-results?q=search+entry so for a tag id just make the tags come out like so <a href="/search-results?q=@tag">@tag</a>

    Which loads it and searches etc, but would there be a way to send a different config via the URL, so it maybe only looks at tags? when I eventually get tags searchable.

  • Ismail Mayat 4200 posts 8813 karma points MVP admin c-trib
    Oct 04, 2018 @ 11:33
    Ismail Mayat
    0

    Kieron,

    I think you may need to update the search code maybe write different end point.

    As far as i know atm it will search whatever fields specified. I am guessing the results page uses a macro and that has the fields to search defined? So as it stands it could end up matching tag in actual content.

    So in theory you could create new page and add macro to that and set field to tag field only and then search then it will only search on tag field.

    Regards

    Ismail

  • Kieron 103 posts 278 karma points
    Oct 04, 2018 @ 11:36
    Kieron
    0

    Ah yeah sorry, i do use a macro;

    @Umbraco.RenderMacro("ezSearch", new {rootContentNodeId="1061", rootMediaNodeId="", indexType="", searchFields="", previewFields="preview, shortOverview", previewLength="", pageSize="", hideFromSearchField="", searchFormLocation="NONE"})
    

    I wonder if i could keep the same page but use a different macro depending on what the URL posts, like append +tagsearch and then the page detect this and like you say refine to only search tags.

    Probably easier to create a new page though, but would be cleaner if i kept the same URL.

    Thank you

  • Kieron 103 posts 278 karma points
    Oct 11, 2018 @ 12:14
    Kieron
    100

    I realized if you simply put your tags object into searchFields="" then ezsearch does search them, so I just did a new macro on a new Tags page, pass it in the URL, and bingo search via tags.

Please Sign in or register to post replies

Write your reply to:

Draft