Forums / Extensions / eZ Find / eZFind 2.0 - exclude authors from search

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

eZ debug

Timing: Jan 29 2025 13:46:47
Script start
Timing: Jan 29 2025 13:46:47
Module start 'content'
Timing: Jan 29 2025 13:46:47
Module end 'content'
Timing: Jan 29 2025 13:46:47
Script end

Main resources:

Total runtime0.2297 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.0781180.7734
Module start 'content' 0.00570.0065 768.8516111.2266
Module end 'content' 0.01210.2175 880.0781540.4219
Script end 0.2296  1,420.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00331.4272200.0002
Check MTime0.00130.5836200.0001
Mysql Total
Database connection0.00100.449710.0010
Mysqli_queries0.178377.63711410.0013
Looping result0.00120.52371390.0000
Template Total0.217194.510.2171
Template load0.00080.360110.0008
Template processing0.216394.185910.2163
Override
Cache load0.00060.252210.0006
Sytem overhead
Fetch class attribute can translate value0.00070.318710.0007
XML
Image XML parsing0.00020.089310.0002
General
dbfile0.01285.5774200.0006
String conversion0.00000.002230.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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