eZ Community » Forums » Extensions » eZ Find » eZFind 2.0 - exclude authors from search
expandshrink

eZFind 2.0 - exclude authors from search

eZFind 2.0 - exclude authors from search

Monday 17 August 2009 9:08:04 am - 12 replies

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.

Monday 24 August 2009 4:05:33 am

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

Tuesday 17 November 2009 12:05:14 pm

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' );

Tuesday 17 November 2009 12:27:50 pm

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

Tuesday 17 November 2009 10: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?

Friday 20 November 2009 3:38:43 pm

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.

Modified on Friday 20 November 2009 3:41:55 pm by Nicolas Jessel

Saturday 21 November 2009 1:14:49 pm

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.

Saturday 21 November 2009 4:11:11 pm

@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

Saturday 21 November 2009 8:21:25 pm

Nesting of queries... you mean a few boolean operators, right ? happy.gif Emoticon

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

Saturday 21 November 2009 9: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

Monday 20 September 2010 4:12:17 am

Hi Paul,

Any recent improvements on this?

Thursday 22 November 2012 11:42:29 am

Is there an update on this? eZ Find is now on Version 2.7

Is it possible to indexboost the owner metafield with a boost of 0 in order to stop searches on author? How might that be done exactly?

Thanks!

Andy

Wednesday 20 August 2014 3:38:59 pm

I played around with search-time boost factors, using RawBoostQueries in ezfind.ini but did not manage to have the desired effect - on eZP 5.2.

(Side note: index-time boost factors are of little use for the common usecase of "search-all-fields in backoffice but only some fields in the frontend" )

I think the lowest boost factor which can be used is 0, which in effect does not prevent a result from showing up.

Modified on Wednesday 20 August 2014 3:39:31 pm by Gaetano Giunta

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from