Self-related article in the 'more like this' results

Author Message

Sergey Gedeon

Monday 24 January 2011 5:35:42 pm

I'm using ezfind fetch 'More like this' to grab related article.

The code looks like:

{def $rel = fetch( 'ezfind', 'moreLikeThis', hash( 'query_type', 'nid',
                                                    'query', $node.node_id,
                                                    'limit', 5,
                                                    'class_id', array('article') )).SearchResult}
{if $rel}
             <ul>
                {foreach $rel as $item}
                   <li><a href={$item.url_alias|ezurl}>{$item.name}</a></li>
                {/foreach}
            </ul>
{/if}

The list contains few actual links but the link to the current article also :(

Anybody know how to remove current article from this list? (the limit should be the same, so I can't remove element directly from the array)

---------------------------------------
To Live Is To Die...
To Die Is To Wake...

Paul Borgermans

Monday 07 February 2011 1:43:29 pm

Mmm, that should not happen: the MoreLikeThis query excludes the article with the node id specified through a dedicated Solr parameter (always on)

I could also not reproduce it locally either (eZ Find 2.3, but all older versions behave the same way)

Can you double check and maybe post the debug output part that lists the query sent to the backend?

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Sergey Gedeon

Thursday 10 February 2011 10:47:08 am

The query is

array(9) {
  ["SearchOffset"]=>
  int(0)
  ["SearchLimit"]=>
  int(5)
  ["Facet"]=>
  NULL
  ["SortBy"]=>
  NULL
  ["Filter"]=>
  NULL
  ["SearchContentClassID"]=>
  array(2) {
    [0]=>
    string(7) "article"
  }
  ["SearchSectionID"]=>
  NULL
  ["SearchSubTreeArray"]=>
  NULL
  ["AsObjects"]=>
  bool(true)
}

And there are no errors in the debug....

This error appears only for one node. I have run updatesearchindexsolr.php several times but this doesn't help me.

---------------------------------------
To Live Is To Die...
To Die Is To Wake...

Paul Borgermans

Friday 11 February 2011 7:54:31 am

try to run updatesearchindexsolr.php with the --clean-all option, I suspect there is some older/stale version still in the index.

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Sergey Gedeon

Tuesday 15 February 2011 2:54:29 am

"

try to run updatesearchindexsolr.php with the --clean-all option, I suspect there is some older/stale version still in the index.

hth

Paul

"

Thanks! I think '--clean-all' option has fix this problem! (now I can't reproduce this bug)

UPD: But now the search results are incorrect - not all classes are displayed... It looks like solr index cannot be updated

UPD2: The nodes are available in the search results only after manual editing of the objects

---------------------------------------
To Live Is To Die...
To Die Is To Wake...

Sergey Gedeon

Tuesday 15 February 2011 5:56:27 am

And the last update - if there are several installations on the server running updatesearchindexsolr.php with the '--clean-all' parameter is not safe. I think '--clean' is enough

---------------------------------------
To Live Is To Die...
To Die Is To Wake...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 23:49:20
Script start
Timing: Jan 29 2025 23:49:20
Module start 'layout'
Timing: Jan 29 2025 23:49:20
Module start 'content'
Timing: Jan 29 2025 23:49:20
Module end 'content'
Timing: Jan 29 2025 23:49:20
Script end

Main resources:

Total runtime0.0208 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.4063151.2422
Module start 'layout' 0.00570.0035 739.648436.7188
Module start 'content' 0.00920.0096 776.367299.4219
Module end 'content' 0.01880.0019 875.789137.9766
Script end 0.0207  913.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.7280140.0002
Check MTime0.00115.1439140.0001
Mysql Total
Database connection0.00063.030810.0006
Mysqli_queries0.003516.879930.0012
Looping result0.00000.063210.0000
Template Total0.00136.210.0013
Template load0.00115.178410.0011
Template processing0.00021.050810.0002
Override
Cache load0.00083.738210.0008
General
dbfile0.00031.304680.0000
String conversion0.00000.037940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs