This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Extensions » eZ Find » most searched in eZ Find
expandshrink

most searched in eZ Find

most searched in eZ Find

Monday 18 January 2010 12:28:57 am - 12 replies

Is it possible to fetch the phrases that have been searched most in eZ Find? Something similar to this function:

http://ez.no/doc/ez_publish/techn.../modules/search/fetch_functions/list

What's the equivalent for eZ Find?

Modified on Monday 18 January 2010 12:31:12 am by Mavko Žmak - Žmale

Monday 18 January 2010 9:01:23 am

Hi Marko

Yes, you can do a fetch with eZ Find, especially since 2.0. Just use search fetch function with an empty query. Note that you can use the filter param as attribute filter.

Take a look at eZFind doc blunk.gif Emoticon.

Example :

{* Fetches the last 10 articles under node 2 *}
{def $list = fetch('content', 'search', hash(
               'query', '',
               'class_id', array('article'),
               'subtree_array', array(2),
               'sort_by', hash('published', 'desc'),
               'limit', 10
             )
     ))}

Modified on Monday 18 January 2010 9:03:11 am by Jérôme Vieilledent

Monday 18 January 2010 10:59:03 am

Take a look at eZFind doc blunk.gif Emoticon.

It is even available online now http://ez.no/doc/extensions/ez_find/2_1.

And yes, using ezfind to replace some complex fetches is definitely a quicker, more flexible option than writing multiple extended attribute filters.

Cheers!

Monday 18 January 2010 1:53:47 pm

Hi Marko,

You can use the same fetch function when ez find is installed to list the most used search phrases, it calls the search log classwhich is not overridden by eZ Find. It is a bit limited obviously, and more extended search loggin will be added in the future, so you can search the search queries themselves

hth

Paul

Monday 18 January 2010 2:15:34 pm

To Jerome and Nicolas: I think you misunderstood what I'm trying to do. I don't want to fetch latest articles, but I want to fetch the most used search phrases (like the functon in the link I mentioned).

To Paul: I have tried using the same fetch function for the most used search phrases, but it seems that it doesn't work properly. This is the problem...

In my public site I have:

SearchViewHandling=template

and in the admin site I have left it to default. And when I fetch the most used search phrases, only phrases that are used in admin interface search are fetched, I don't get any phrase used in the public site (although they should be here, because they were used a lot more than phrases in the admin interface).

Does this mean that logging most searched phrases doesn't work in eZFind when SearchViewHandling=template is set?

Modified on Monday 18 January 2010 2:24:21 pm by Mavko Žmak - Žmale

Monday 18 January 2010 2:43:07 pm

Marko, you found a bug

Can you please file an issue?

When using ezfind/search fetch functions directly, the search log handler isn't called at all

I'll probably make this configurable, and add a parameter for it as well:

- when using ezfind fetch functions as a faster alternative for content fetch functions, search logging is irrelevant

- search logging has quite a considerable overhead with the DB implementation currently available

Regards

Paul

Modified on Monday 18 January 2010 3:25:31 pm by Paul Borgermans

Monday 18 January 2010 3:42:43 pm

@Marko : Sorry, I misunderstood your question happy.gif Emoticon

@Paul : So eZ Find overrides default search/list fetch function ? Is there a way to add auto-completion (with a dropdown list of suggestions like in Amazon) ?

Monday 18 January 2010 4:30:05 pm

@Marko : Sorry, I misunderstood your question happy.gif Emoticon

@Paul : So eZ Find overrides default search/list fetch function ? Is there a way to add auto-completion (with a dropdown list of suggestions like in Amazon) ?

Jérôme: no, it does not override search/list (which calls the class eZSearchLog)

About autocompletion, that should be a new thread blunk.gif Emoticon

But the short answer: it did not make it for the next ez find release, though Solr has a nice 'backend" feature for it (the "terms" request handler)

Paul

Monday 18 January 2010 6:22:00 pm

Marko, you found a bug

Can you please file an issue?

When using ezfind/search fetch functions directly, the search log handler isn't called at all

OK, I'll file an issue, but since I need this functionality rather quickly is there some quickfix that I can do for this to work?

Monday 18 January 2010 9:33:24 pm

I repoted this as a bug:

http://issues.ez.no/IssueView.php?Id=16045

Monday 18 January 2010 9:56:39 pm

I repoted this as a bug:

http://issues.ez.no/IssueView.php?Id=16045

And that's a good catch happy.gif Emoticon
The quick way around it would be to not use template search, is this an option ?

Monday 18 January 2010 10:05:17 pm

And that's a good catch happy.gif Emoticon
The quick way around it would be to not use template search, is this an option ?

Not using template is not an option unfortunately... I have a search form with a lot of different parameters that have to be parsed and converted before making the actual search.

Is there a possibility for a quick fix / hack? Paul?

Monday 18 January 2010 11:04:43 pm

Marko, are you running ezfind 2.0 or 2.1?

If it is ok to log any search query (including the "non human" ones), then hack extension/ezfind/search/plugins/ezsolr/ezsolr.php in function search

and look for the line with

if ( count($resultArray) > 0 )
        {
            $result = $resultArray['response'];
            $searchCount = $result['numFound'];
..

add after these

eZSearchLog::addPhrase( $searchText, $searchCount );

That should do the trick (untested though)

hth

Paul

Modified on Monday 18 January 2010 11:05:31 pm by Paul Borgermans

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from