I'm Cc-ing this discussion back to the list.

On 06/02/2010 09:05 AM, Sven Deichmann wrote:
> I can not imagine any reason why solr itself would require that path
> is set.

Correct. See http://localhost:8983/solr/admin/ on a running solr 
instance. No path there if you do a search.

> It is probably much easier: I would guess there is some code in the
> current implementation that inserts the path if it is NOT already there
> (IIRC I noticed code like that).
> This is a behaviour you would probably want to configure through the
> solr controlpanel from within plone.

I've analysed collective.solr and the behaviour you're searching is 
already parametrized (for search):

skins/solr_site_search/search.pt:                 use_navigation_root 
request/use_navigation_root | python:True;

The actual insertion is done in skins/solr_site_search/queryCatalog.py:


def rootAtNavigationRoot(query):
     if 'path' not in query:
         query['path'] = getNavigationRoot(context)

...
         if use_navigation_root:
             rootAtNavigationRoot(query)
...

You can insert a false value for use_navigation_root to get a global 
cross-site search.

What doesn't work:
&use_navigation_root=False
&use_navigation_root=0

What *does* work:
&use_navigation_root=

i.e. just the parameter, no value.

This means you can replace your custom browser view that enumerates all 
paths by a simple customization of search.pt that defaults 
use_navigation_root to False instead of True.

Since you were looking to apply this behaviour also elsewhere, i.e. 
outside of search for tag enumeration etc., you'd have to check if those 
entry points use queryCatalog and then either customize the specific 
entry point to insert use_navigation_root=(nothing) or else customize 
queryCatalog globally to always search all sites. I can't imagine that 
the latter can be valid, it'll hose all kinds of functionality that 
expect a site context I guess and probably create security issues as a 
bonus. Better play it safe and introduce the global cross-site context 
on exactly those functionalities that you choose to behave that way.

:*CU#
-- 
***   Guido A.J. Stevens        ***   tel: +31.43.3618933    ***
***   [email protected]   ***   Postbus 619            ***
***   http://www.cosent.nl      ***   6200 AP  Maastricht    ***

             s h a r i n g    m a k e s    s e n s e

    RT @lukegrange: One reason we sometimes are afraid to speak up
    is because we worry that our idea is too small. From little
    things big th ...

    http://twitter.com/GuidoStevens
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to