Using faceted search as a replacement for site search

32 views
Skip to first unread message

Chris Milway

unread,
Aug 27, 2015, 12:06:33 PM8/27/15
to EEA Faceted Navigation
The documentation states you can use EEA.facetednavigation to replace the advanced search in Plone. 2 questions:

  1. How? I don't see a confliglet or other option to do this, nor can I by looking through the code
  2. Could I replace the non-advanced search as well? I want to present the faceted search interface alongside search results, so users can filter their results once they have done an initial search via the standard search viewlet

Chris Milway

unread,
Aug 28, 2015, 5:18:13 AM8/28/15
to EEA Faceted Navigation
OK, so I've made some progress but not as much as I'd like and I still need some help.

I've added a folder at the root of my site with the id 'search', and modifed the search viewlet to point t that rather than the search browser view.

I've added a TAL expression widget with the value 'request/form/SearchableText|nothing', but it seems to be falling back to nothing even when the 'SearchableText' form data is present. I have a debug widget which tells me the catalog lookup it is doing is '{'Language': ['en', ''], 'SearchableText': None}' even though the url I'm accessing the folder on is '[portal_url]/search?SearchableText=Test'

If I change the fallback e.g. 'request/form/SearchableText|string:foo' then the catalog lookup changes appropriately to '{'Language': ['en', ''], 'SearchableText': 'foo'}'.

Is there something preventing me from using the form data in the request? The readme in the code seems to suggest that I can access the request at least.

Chris Milway

unread,
Aug 28, 2015, 5:26:21 AM8/28/15
to EEA Faceted Navigation
I also meant to add I tried they same but as a python expression e.g. 'python:request.form.get('SearchableText') or None' but that doesn't work either.

Alin Voinea

unread,
Aug 31, 2015, 8:00:09 AM8/31/15
to EEA Faceted Navigation
Hi Chris,

Sorry for the delay - you know, holidays :).

Thus, your viewlet should point to '[portal_url]/search#SearchableText=Test' (notice the # instead of ?)

Also, the TAL expression should be: python:request.form.get('SearchableText[]', None) or None

Cheers,
Alin

Alin Voinea

unread,
Aug 31, 2015, 8:06:04 AM8/31/15
to EEA Faceted Navigation
You can also try this TAL expession:

python:request.form.get('SearchableText[]') or 'FACET-EMPTY'

Chris Milway

unread,
Aug 31, 2015, 8:06:39 AM8/31/15
to eea-facete...@googlegroups.com

Awesome, thanks. Bank holiday today so will try this tomorrow.

Chris

--
You received this message because you are subscribed to a topic in the Google Groups "EEA Faceted Navigation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eea-facetednavigation/bQr88ZoFG9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eea-facetednavig...@googlegroups.com.
To post to this group, send email to eea-facete...@googlegroups.com.
Visit this group at http://groups.google.com/group/eea-facetednavigation.
For more options, visit https://groups.google.com/d/optout.

Chris Milway

unread,
Sep 1, 2015, 4:25:24 AM9/1/15
to EEA Faceted Navigation
Awesome, that works great. Thank you very much.

Chris

Chris Milway

unread,
Sep 4, 2015, 9:40:13 AM9/4/15
to EEA Faceted Navigation
Hi

Is there any way to get the UI to treat the value of the tal facet the same as other facets? I'm having trouble with 2 things:

1. The search string isn't appearing in the 'Current search' panel
2. The counts aren't including the search string when they do their catalog lookup. e.g. the tag facet will say there are 24 results for a tag when there are only 6 results once the search string is taken into account.

Any help would be much appreciated.

Chris

Alin Voinea

unread,
Sep 7, 2015, 9:02:58 AM9/7/15
to EEA Faceted Navigation


On Friday, September 4, 2015 at 4:40:13 PM UTC+3, Chris Milway wrote:
Hi

Is there any way to get the UI to treat the value of the tal facet the same as other facets? I'm having trouble with 2 things:

1. The search string isn't appearing in the 'Current search' panel

AFAIK, no! You should try to use the "Text field" instead of the TAL expression facet like this:

1. Configure faceted-navigation
2. Export to XML
3. Edit XML and change "text field" id from c4 to SearchableText or whatever
4. Import faceted configuration from your XML

 
2. The counts aren't including the search string when they do their catalog lookup. e.g. the tag facet will say there are 24 results for a tag when there are only 6 results once the search string is taken into account.

 
This seems to be a bug!

Chris Milway

unread,
Sep 7, 2015, 9:16:44 AM9/7/15
to eea-facete...@googlegroups.com
On the text field – Legend! Thank you that works.

On the count – it only seems to be an issue (since doing the above anyway) on the first loading of the facets. If I select an additional option triggering the facets to refresh, the count is from then on correct.

Chris

--

Jean-Sébastien Mansart

unread,
Sep 18, 2015, 10:20:15 AM9/18/15
to EEA Faceted Navigation

Hello,

I'm doing the same thing than Chris, but how do you change the viewlet to make it point to search#SearchableText= with the # in a form ?

Thanks

Chris Milway

unread,
Sep 18, 2015, 11:56:22 AM9/18/15
to eea-facete...@googlegroups.com
I used a snippet of jQuery that works on form submit:

        $('form#searchGadget_form').submit(function(e) {
          e.preventDefault();
          var field = $(this).find('#searchField')
          var url = $(this).attr('action') + '#SearchableText=' + field.val();
          location = url;
        });

--

Jean-Sébastien Mansart

unread,
Sep 21, 2015, 10:03:46 AM9/21/15
to EEA Faceted Navigation
ok, thanks !


Le vendredi 18 septembre 2015 17:56:22 UTC+2, Chris Milway a écrit :
I used a snippet of jQuery that works on form submit:

        $('form#searchGadget_form').submit(function(e) {
          e.preventDefault();
          var field = $(this).find('#searchField')
          var url = $(this).attr('action') + '#SearchableText=' + field.val();
          location = url;
        });
On Fri, Sep 18, 2015 at 3:20 PM, Jean-Sébastien Mansart <jean.sebast...@gmail.com> wrote:

Hello,

I'm doing the same thing than Chris, but how do you change the viewlet to make it point to search#SearchableText= with the # in a form ?

Thanks


Le lundi 31 août 2015 14:00:09 UTC+2, Alin Voinea a écrit :
Hi Chris,

Sorry for the delay - you know, holidays :).

Thus, your viewlet should point to '[portal_url]/search#SearchableText=Test' (notice the # instead of ?)

Also, the TAL expression should be: python:request.form.get('SearchableText[]', None) or None

Cheers,
Alin





On Friday, August 28, 2015 at 12:26:21 PM UTC+3, Chris Milway wrote:
I also meant to add I tried they same but as a python expression e.g. 'python:request.form.get('SearchableText') or None' but that doesn't work either.

--
You received this message because you are subscribed to a topic in the Google Groups "EEA Faceted Navigation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eea-facetednavigation/bQr88ZoFG9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eea-facetednavigation+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages