Copied to clipboard

Flag this post as spam?

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


  • Johannes Lantz 55 posts 260 karma points
    Jan 04, 2019 @ 20:22
    Johannes Lantz
    0

    Examine result differ in backoffice and in frontend

    Hi guys!

    I have been trying to implement Examine search to my project. It's working quite good. But I noticed that some searches doesn't return anything in the frontend but if I try to search in the backoffice I get a result.

    Frontend: Front end

    Backoffice: Backoffice

    I have been trying to solve this for a while now. I am guessing this has to do with the "-" but I am unsure. Any ideas?

             var searchQuery = Request.QueryString["q"];
    var searcher = Examine.ExamineManager.Instance.SearchProviderCollection["Searcher"];
                @if (!string.IsNullOrEmpty(searchQuery))
                {
                    foreach (var result in searcher.Search(searchQuery, true).Where(x => Umbraco.Content(x.Id).AncestorOrSelf("Lanugage").Id == langNode.Id).OrderByDescending(x => x.Score)
                    {
    
  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Jan 06, 2019 @ 01:06
    Nathan Woulfe
    1

    Might be an obvious response, but are you comparing the same index on frontend and in the backoffice?

    Other thing to consider would be the indexer type - the different indexers manage whitespace, numerics, special chars etc differently.

  • Johannes Lantz 55 posts 260 karma points
    Jan 07, 2019 @ 05:59
    Johannes Lantz
    100

    Thank you Nathan! I took a closer look at the indexer and when i removed

    <IndexAttributeFields>
      <add Name="id" />
      <add Name="nodeName" />
      <add Name="updateDate" />
      <add Name="writerName" />
      <add Name="loginName" />
      <add Name="email" />
      <add Name="nodeTypeAlias" />
    </IndexAttributeFields>
    

    it worked as a charm!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies