Forums / Extensions / eZ Find / Self-related article in the 'more like this' results

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...

eZ debug

Timing: Jan 17 2025 23:56:22
Script start
Timing: Jan 17 2025 23:56:22
Module start 'content'
Timing: Jan 17 2025 23:56:23
Module end 'content'
Timing: Jan 17 2025 23:56:23
Script end

Main resources:

Total runtime0.8944 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.4141180.7656
Module start 'content' 0.00700.7673 770.1797589.9609
Module end 'content' 0.77430.1200 1,360.1406341.3750
Script end 0.8944  1,701.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.5542210.0002
Check MTime0.00230.2535210.0001
Mysql Total
Database connection0.00080.088110.0008
Mysqli_queries0.810190.56562050.0040
Looping result0.00210.23192030.0000
Template Total0.861096.320.4305
Template load0.00260.293620.0013
Template processing0.858395.960620.4292
Template load and register function0.00020.020110.0002
states
state_id_array0.00090.102710.0009
state_identifier_array0.00100.112220.0005
Override
Cache load0.00240.2651380.0001
Sytem overhead
Fetch class attribute can translate value0.00140.153230.0005
Fetch class attribute name0.00150.163880.0002
XML
Image XML parsing0.00310.342030.0010
class_abstraction
Instantiating content class attribute0.00000.0028120.0000
General
dbfile0.00470.5251330.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs