eZFind 2.0 - exclude authors from search

Author Message

Mirko Battisti

Monday 17 August 2009 12:08:04 am

Hello everybody.

Is there a way to avoid content authors to be indexed by eZFind?
I've looked everywhere in the config files, but I can't seem to find anything.
What I would like to avoid is result to show up if someone inputs the author name/surmane in the search field. It looks like solr gets the author name and surname and puts them into the 'meta_owner_name_t' field.
Any idea?
Thanks!
Mirko.

Mark Marsiglio

Sunday 23 August 2009 7:05:33 pm

I think that this would require the metafield indexboost feature (not implemented in 2.0) to put an indexboost factor of 0.0.

I have not been able to find out yet if this feature will be implemented in 2.1

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Fabien Mas

Tuesday 17 November 2009 3:05:14 am

Hi,

The only way I found was to hack the ..\extension\ezfind\classes\ezfezpsolrquerybuilder.php file

Line 223, comment this line:

// $queryFields[] = eZSolr::getMetaFieldName( 'owner_name' );

Bertrand Dunogier

Tuesday 17 November 2009 3:27:50 am

If there was no other way, you could submit an enhancement request for this on http://issues.ez.no/ezfind.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Paul Borgermans

Tuesday 17 November 2009 1:29:28 pm

The use cases I encountered so far typically want this as a "user" site access feature; while still wanting it in the admin interface or when creating own dedicated search templates

What is yours here?

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

Nicolas Jessel

Friday 20 November 2009 6:38:43 am

Hello,

To have generic solution, we can do this in ezfind.ini.append.php file:

[SiteSettings]
## PATCH NJESSEL - 20091120
## Parameter to display or not owner results
## when owner name is enter in search engine
## value = enabled or disabled
## test add in ezfezpsolrquerybuilder.php in buildSearch() method
## if ( self::$FindINI->variable( 'SiteSettings', 'SearchOwnerResults' ) == 'enabled' )
## $queryFields[] = eZSolr::getMetaFieldName( 'owner_name' );
SearchOwnerResults=disabled

Like that, we can display, or not, results in each siteaccess

Bye.

Bertrand Dunogier

Saturday 21 November 2009 4:14:49 am

Your approach ain't bad, Nicolas. But don't you think it's a bit limiting ?

You could first make the setting an array, maybe with a default global value, so that you can configure this behaviour by class. Ultimately, it would also be very interesting to make this a possible per class search parameter. So that you can enable author lookup for class A, but disable it for class B.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Paul Borgermans

Saturday 21 November 2009 7:11:11 am

@Bertrand: doing such queries with variations per class would need nesting of queries (and quite a different API in the fetch functions)

A possible solution (using boost functions) suffers from a bug I'll address later this weekend, I'll implement it with the newer Solr 1.4 syntax as well

Paul

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

Bertrand Dunogier

Saturday 21 November 2009 11:21:25 am

Nesting of queries... you mean a few boolean operators, right ? :)

It is indeed more complex than what Nicolas proposed, but I don't think it requires a very heavy change.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Paul Borgermans

Saturday 21 November 2009 12:24:45 pm

@Bertrand: no I don't mean "a few boolean operators", that would not work at all

I mean Solr nested queries, a new feature since 1.4

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

Andrew Duck

Sunday 19 September 2010 7:12:17 pm

Hi Paul,

Any recent improvements on this?

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

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