Forums / Extensions / eZ Find / most searched in eZ Find

most searched in eZ Find

Author Message

Marko Žmak

Sunday 17 January 2010 3:28:57 pm

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/technical_manual/4_x/reference/modules/search/fetch_functions/list

What's the equivalent for eZ Find?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Jérôme Vieilledent

Monday 18 January 2010 12: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 ;).

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
             )
     ))}

Nicolas Pastorino

Monday 18 January 2010 1:59:03 am

"

Take a look at eZFind doc ;).

"

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!

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Paul Borgermans

Monday 18 January 2010 4:53:47 am

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

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Marko Žmak

Monday 18 January 2010 5:15:34 am

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?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Paul Borgermans

Monday 18 January 2010 5:43:07 am

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

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Jérôme Vieilledent

Monday 18 January 2010 6:42:43 am

@Marko : Sorry, I misunderstood your question :)

@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) ?

Paul Borgermans

Monday 18 January 2010 7:30:05 am

"

@Marko : Sorry, I misunderstood your question :)

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

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

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Marko Žmak

Monday 18 January 2010 9:22:00 am

"

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?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Monday 18 January 2010 12:33:24 pm

I repoted this as a bug:

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

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Pastorino

Monday 18 January 2010 12:56:39 pm

"

I repoted this as a bug:

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

"

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

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Marko Žmak

Monday 18 January 2010 1:05:17 pm

"

And that's a good catch :)
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?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Paul Borgermans

Monday 18 January 2010 2: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

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans