• rvturnage

    (@rvturnage)


    I’m a new user, using with Oxygen 3.7. and running into a strange issue on the search results. On the indexing tab, I set Relvanssi to index SOME custom fields and specify ct_builder_shortcodes (which is loaded by default when I activated Relvanssi). Then I build the index. If I enter a page ID in the debug field, it looks like it’s indexed properly.

    But when I actually perform a search for one of the headings on that page, it doesn’t appear in my initial results (it does get shown on like page 4 or 6 depending on if Im searching partial or whole word.). I find this odd, since it should be sorting by relevance and an exact match of a heading should be highly relevant. I’ve set exact match in the content to be boosted by 130 and the page with the headline is lower on the relevant list.

    Now if I change the indexing tab to index VISIBLE custom fields, rebuild the database, and use the same search phrase… the page shows in the top spot on my results page as it should. When looking at the debug tab now, the same keywords appear along with a lot of other garbage that I assume is from the few ACF fields being used.

    I’m using Ajax Load More on my search results page. I also tried it using Oxygen’s default easy posts and got the same results. I’ve tried the latest (4.12.3). i’ve also tried 4.9 and 4.8 with no luck. Any insights?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Note that content weight boost does not apply to Oxygen content, because for Relevanssi, it’s not post content, it’s custom field content (because it comes from the ct_builder_shortcodes custom field). That might explain the low positions.

    Can you please show me screenshots of the debug screen with the different custom field indexing settings?

    Thread Starter rvturnage

    (@rvturnage)

    Hi, Mikko. Good to know about the weight boost. Makes sense. What’s strange is that the position isn’t low if I index VISIBLE fields.

    This is what I get if I set indexing to SOME fields and specify ct_builder_shortcodes: https://postimg.cc/sG7cfXqZ

    But the page does not show at the top spot.

    If I change the indexing to VISIBLE fields, I get this in debug: https://postimg.cc/Q9Rmr543

    And the page does show at the top spot.

    Thanks for any insights.

    Plugin Author Mikko Saari

    (@msaari)

    That’s interesting; that should not make any difference. Is the post relevancy score the same in both cases? Is there any difference in that? You can see that easily in the Relevanssi admin search (Dashboard > Admin search).

    Thread Starter rvturnage

    (@rvturnage)

    So if I set indexing custom fields to VISIBLE, the post relevancy is 7406.79

    If I set it to SOME and specify ct_builder_shortcodes, the relevancy score 352.57

    Plugin Author Mikko Saari

    (@msaari)

    What the keyword is you’re searching for?

    Thread Starter rvturnage

    (@rvturnage)

    “Next-Level Technology for Clinicians in Every Department” – it’s a headline on a clinical solutions page.

    Thread Starter rvturnage

    (@rvturnage)

    It almost looks like it’s a weighting issue. When I look at the results, everything above my clinical solutions page is a post of some kind…podcast, blog post, etc that is using wordpress content editor. the Oxygen builder content that is in the custom field would appear to be weighted less.

    But what I can’t understand is why that would change when i include VISIBLE custom fields in the index, and my clinical solution shoots to the top of the results.

    I’ve also tried it with Boost Exact Matches on and off, with no change.

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, I don’t understand this either. Let’s study further. What does this print out?

    add_filter( 'relevanssi_match', 'rlv_test_match' );
    function rlv_test_match( $match ) {
        if ( xxx == $match->doc ) {
            var_dump( $match );
        }
        return $match;
    }

    Replace xxx with the post ID of this post and then run a search with this both ways. Is there a difference?

    Thread Starter rvturnage

    (@rvturnage)

    indexing SOME custom fields (ct_builder_shortcodes)

    object(stdClass)#2912 (22) { ["doc"]=> string(3) "398" ["term"]=> string(5) "level" ["term_reverse"]=> string(5) "level" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(1) "1" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(1) ["taxonomy_score"]=> float(0) ["weight"]=> float(44.0707360822) } object(stdClass)#3391 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "clinicians" ["term_reverse"]=> string(10) "snaicinilc" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(1) "3" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(3) ["taxonomy_score"]=> float(0) ["weight"]=> float(132.21202127) } object(stdClass)#3929 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "department" ["term_reverse"]=> string(10) "tnemtraped" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(1) "3" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(3) ["taxonomy_score"]=> float(0) ["weight"]=> float(132.211988241) } object(stdClass)#4233 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "technology" ["term_reverse"]=> string(10) "ygolonhcet" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(1) "1" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(1) ["taxonomy_score"]=> float(0) ["weight"]=> float(44.0706459486) }

    Indexing VISIBLE I get this
    object(stdClass)#2900 (22) { ["doc"]=> string(3) "398" ["term"]=> string(5) "level" ["term_reverse"]=> string(5) "level" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(2) "21" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(21) ["taxonomy_score"]=> float(0) ["weight"]=> float(925.850115451) } object(stdClass)#3405 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "clinicians" ["term_reverse"]=> string(10) "snaicinilc" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(2) "63" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(63) ["taxonomy_score"]=> float(0) ["weight"]=> float(2777.5463867) } object(stdClass)#3976 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "department" ["term_reverse"]=> string(10) "tnemtraped" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(2) "63" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(63) ["taxonomy_score"]=> float(0) ["weight"]=> float(2777.54573631) } object(stdClass)#4290 (22) { ["doc"]=> string(3) "398" ["term"]=> string(10) "technology" ["term_reverse"]=> string(10) "ygolonhcet" ["content"]=> string(1) "0" ["title"]=> string(1) "0" ["comment"]=> string(1) "0" ["tag"]=> string(1) "0" ["link"]=> string(1) "0" ["author"]=> string(1) "0" ["category"]=> string(1) "0" ["excerpt"]=> string(1) "0" ["taxonomy"]=> string(1) "0" ["customfield"]=> string(2) "21" ["mysqlcolumn"]=> string(1) "0" ["taxonomy_detail"]=> string(0) "" ["customfield_detail"]=> string(0) "" ["mysqlcolumn_detail"]=> string(0) "" ["type"]=> string(4) "post" ["item"]=> string(1) "0" ["tf"]=> float(21) ["taxonomy_score"]=> float(0) ["weight"]=> float(925.848247482) }

    Plugin Author Mikko Saari

    (@msaari)

    Ok, so the difference is that with visible fields indexed, the words “level” and “technology” appear 21 times and the words “clinicians” and “department” appear 63 times, and with only the one field indexed, they appear once and three times respectively. That’s why the weights are 21 times bigger.

    With only one field indexed, Relevanssi just sees the content you build from the ACF fields in the ct_builder_shortcodes, but if you have all visible fields indexed, Relevanssi reads in both the source ACF fields and the complete content, leading to seeing the same content multiple times.

    Part of the problem here is that big part of the weights does not work as expected in Oxygen, because Oxygen does not have post content as such, everything is just custom fields. All that custom field content has by default fairly light weight.

    In general it would be best to only index the ct_builder_shortcodes field if all field content is reflected there. The main question here is now what is boosting the other content before the better matches. What is giving weight for the posts higher in the rankings?

    Thread Starter rvturnage

    (@rvturnage)

    The posts are pulling the content from WordPress content editor, not Oxygen custom fields. The page is pulling all its content from Oxygen custom field. So if custom fields are “fairly light weight” by default, that would explain it right?

    Plugin Author Mikko Saari

    (@msaari)

    Yes, that’s all – I thought all content in Oxygen came from the custom fields, but if you have something that’s in post content and got plenty of content weight, that’s all this needs. Drop the content weight to 1, and it’ll be on the same level as the custom fields.

    If necessary, here are tools for increasing custom field weight.

    Thread Starter rvturnage

    (@rvturnage)

    Okay, so I definitely will adjust the weights. Thank you for helping me figure that out.

    What’s confusing me is why when set to “VISIBLE”, the result weights are 21 times higher for the page. There are no additional fields that would contain those phrases. the only ACF fields I have in place are for whether to show the author’s name. And the wordpress content area is empty on that page.

    There are 9 page revisions. The first being empty. Would it be reading page revisions when “VISIBLE” is set?

    • This reply was modified 4 years ago by rvturnage.
    Plugin Author Mikko Saari

    (@msaari)

    No, it’s not reading revisions (those are different posts with different post IDs, and separate entities as far as Relevanssi is considered).

    It’s hard to say why without knowing what happens in the indexing. This indexing debugging trick might shed some light on it. Maybe it’s some ACF meta fields? I don’t know, and the default debugger doesn’t help here either.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Search results sorting in Oxygen’ is closed to new replies.