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 156 posts 838 karma points c-trib
    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 447 posts 1664 karma points MVP 5x hq 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 156 posts 838 karma points c-trib
    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!

Please Sign in or register to post replies

Write your reply to:

Draft