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