H Andrea,

After further investigation, I've found that the filter is being 
applied...but not for the home page.

In other words, I have this configuration in discovery.xml:



   <!--Any default filter queries, these filter queries will be used for 
all queries done by discovery for this configuration-->
        <property name="defaultFilterQueries">
            <list>
                <!--Only find items-->
                <!--<value>search.resourcetype:2</value>-->
                <value>-dc.contributor.author:"Radio Alcoy"</value>
                <value>-dc.contributor.author:"Radio París"</value>
            </list>
        </property>

.....

 <bean id="searchFilterAuthor" 
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
        <property name="indexFieldName" value="author"/>
        <property name="metadataFields">
            <list>
                <value>dc.contributor.author</value>
                <value>dc.creator</value>
            </list>
        </property>
        <property name="facetLimit" value="5"/>
        <property name="sortOrder" value="COUNT"/>
    </bean>
.....

After reindexing, all the references to "Radio Alcoy" or "Radio París" in 
the author facet in communities or collections home page are gone, but the 
author facet in the home page still shows this references.

Having a look at solr.log shows that the default filter query is being 
aplied, indeed:

2016-04-20 18:54:56,985 INFO  org.apache.solr.core.SolrCore @ [search] 
webapp=/solr path=/select 
params={q=*:*&fl=dateIssued.year,handle,search.resourcetype,search.resourceid&start=0&fq=NOT(withdrawn:true)&fq=NOT(discoverable:false)&fq=
*-dc.contributor.author:"Radio+Alcoy"&fq=-dc.contributor.author:"Radio+París"*&fq=location:m335&fq=dateIssued.year:[*+TO+*]&fq=read:(g0+OR+g0)&sort=dateIssued.year_sort+asc&rows=1&wt=javabin&version=2}
 
hits=1022 status=0 QTime=81
2016-04-20 18:54:57,003 INFO  org.apache.solr.core.SolrCore @ [search] 
webapp=/solr path=/select 
params={q=*:*&fl=dateIssued.year,handle,search.resourcetype,search.resourceid&start=0&fq=NOT(withdrawn:true)&fq=NOT(discoverable:false)&fq=-dc.contributor.author:"Radio+Alcoy"&fq=-dc.contributor.author:"Radio+París"&fq=location:m335&fq=location:m335&fq=dateIssued.year:[*+TO+*]&fq=read:(g0+OR+g0)&sort=dateIssued.year_sort+desc&rows=1&wt=javabin&version=2}
 
hits=1022 status=0 QTime=8

So, why is still "Radio Alcoy" and "Radio París" appearing in the author 
home page facet but not in others?

Regards.

On Monday, April 18, 2016 at 1:42:52 PM UTC+2, Andrea Bollini wrote:
>
> Hi Rafa,
> it is strange that the filter doesn't work, if you share the relevant part 
> of your spring configuration and your solr logs we can try to understand. 
> Anyway, note that using the filter will esclude the Van de Velde authored 
> items from the result and not only his name from the author facets.
>
> I discourage you to attempt to remove the name from the facet list after 
> the search, it is complex as it also affect pagination of facets result. 
> IMHO it is better to avoid indexing of the value at all.
>
> Place to look to prevent indexing
>
> https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java#L1088
> try something like 
> if ("Van de Velde, Kevin".equalsIgnoreCase(value)) continue;
> obviously you need to make the code more general and configurable, maybe 
> you want to check also which facet is indexing.
>
> The above solution is a very clumsy patch... an elegant solution, as the 
> one adopted in DSpace-CRIS, requires the ability to index virtual metadata 
> that can be external defined (filtering existent one as in your use case)
>
> I don't know where in the code is controlled the resultset sent to 
> static-sidebar-facet.jsp. 
>
>
> https://github.com/DSpace/DSpace/blob/master/dspace-jspui/src/main/java/org/dspace/app/webui/discovery/DiscoverySearchRequestProcessor.java#L166
>
> but as you can see following the code the mapping between the SOLR 
> response and the java object used by the view is done at a very low level 
> in the DSpace API.
>
> Hope this help,
> Andrea
>
>
> Il 18/04/2016 11:24, Rafa Carreres ha scritto:
>
> Hi Andrea,
>
> Thank you for your help. 
>
> According to this, filtering with -dc.contributor.author:"Van de Velde, 
> Kevin" should show all the authors but that one, but unfortunately it 
> doesn't work. Oddly, the same query in SOLR web interface works perfectly, 
> excluding those items including that particular author.
>
> Checking out solr.log shows that the filter is being applied but with no 
> effect.
>
>
> Another approach I'm currently is to modify the code in 
> static-sidebar-facet.jsp to exclude those authors I don't want to be showed 
> in the facet.
> It works, but, instead of 5 authors (I have limit=5), for example, it 
> shows 4, as "Van de Velde, Kevin" has been excluded.
>
> I don't know where in the code is controlled the resultset sent to 
> static-sidebar-facet.jsp. 
>
> Any clue about this point? 
>
> Regards,
>
>
>
>
> On Thursday, April 14, 2016 at 3:02:31 PM UTC+2, Andrea Bollini wrote: 
>>
>> Hi Rafa,
>> the defaultFilterQueries parameter allows you to limit the result set. 
>> The facet are automatically build upon the result. This mean that in your 
>> case you will have in the author facet only Van de Velde, Kevin and his 
>> coauthors. Also if you write the opposite query, i.e.
>> -dc.contributor.autor:"Van de Velde, Kevin"
>> I guess that the result will be not what you expect. No items where Van 
>> de Velde appears as author will be retrieved, so it will be not included in 
>> the author facet but I guess that this is more restrictive than what you 
>> want to achieve.
>>
>> To exclude a terms from a facet the only way is to prevent such term to 
>> be indexed and you can do that only customizing the code.
>>
>> In DSpace-CRIS you can easily achieve such goal implementing an 
>> EnhancedValueGenerator and using such virtual metadata (i.e. 
>> item.filteredauhor) in the discovery facet configuration
>> it.cineca.surplus.ir.defaultvalues.EnhancedValuesGenerator
>>
>> An example of virtual metadata build using this interface in DSpace-CRIS 
>> and used in discovery can be found here:
>>
>> https://github.com/Cineca/DSpace/blob/dspace-5_x_x-cris/dspace-api/src/main/java/it/cineca/surplus/ir/defaultvalues/FulltextInfoGenerator.java
>>
>> https://github.com/Cineca/DSpace/blob/dspace-5_x_x-cris/dspace/config/spring/cris/cris-metadata-enhancers.xml#L167
>>
>> https://github.com/Cineca/DSpace/blob/dspace-5_x_x-cris/dspace/config/spring/api/discovery.xml#L1722
>>
>> Hope this help,
>> Andrea
>>
>>
>>
>>
>>
>> Il 14/04/2016 10:48, Rafa Carreres ha scritto:
>>
>> Hi all, 
>>
>> In DSpace 5 (Jspui) I have a facet for authors. But, I would like to 
>> exclude certain authors from the facet. 
>>
>> I have read the documentation ( 
>> <https://wiki.duraspace.org/display/DSDOC5x/Discovery>
>> https://wiki.duraspace.org/display/DSDOC5x/Discovery) about discovery 
>> and "Adding default filter queries (OPTIONAL)".
>>
>> According to this, if I define something like this:
>>
>> <property name="defaultFilterQueries">
>>     <list>
>>         <value>dc.contributor.author: "Van de Velde, Kevin"</value>
>>     </list>
>> </property>
>>
>> Does it mean that I'll only get "Van de Velde, Kevin" in the author facet?
>>
>> If so, how could I EXCLUDE a number of author from the facet? What's the 
>> syntax for this?
>>
>>
>> Regards,
>>
>> Rafa Carreres
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "DSpace Technical Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> -- 
>> Andrea Bollini
>> International Business Development, Deputy Leader
>> Open Source & Open Standards Strategy, Head
>> Cineca
>>
>> Via dei Tizii, 6
>> 00185 Roma, Italy
>> tel. +39 06 44 486 087 - mob. +39 348 82 77 525http://www.cineca.it 
>>
>>
>
> -- 
> Andrea Bollini
> International Business Development, Deputy Leader
> Open Source & Open Standards Strategy, Head
> Cineca
>
> Via dei Tizii, 6
> 00185 Roma, Italy
> tel. +39 06 44 486 087 - mob. +39 348 82 77 525http://www.cineca.it 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to