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

eZ debug

Timing: Jan 17 2025 23:50:24
Script start
Timing: Jan 17 2025 23:50:24
Module start 'content'
Timing: Jan 17 2025 23:50:25
Module end 'content'
Timing: Jan 17 2025 23:50:25
Script end

Main resources:

Total runtime1.0044 sec
Peak memory usage4,096.0000 KB
Database Queries232

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 589.1719180.7813
Module start 'content' 0.00830.8184 769.9531791.3672
Module end 'content' 0.82670.1776 1,561.3203361.3047
Script end 1.0043  1,922.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4176210.0002
Check MTime0.00170.1654210.0001
Mysql Total
Database connection0.00090.084810.0009
Mysqli_queries0.875487.15102320.0038
Looping result0.00250.24852300.0000
Template Total0.970596.620.4853
Template load0.00240.237120.0012
Template processing0.968196.388820.4841
Template load and register function0.00010.009610.0001
states
state_id_array0.00100.099610.0010
state_identifier_array0.00070.071520.0004
Override
Cache load0.00240.24011050.0000
Sytem overhead
Fetch class attribute can translate value0.00130.128550.0003
Fetch class attribute name0.00090.0905170.0001
XML
Image XML parsing0.00270.263950.0005
class_abstraction
Instantiating content class attribute0.00010.0057260.0000
General
dbfile0.00330.3331490.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
13content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
25content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
3content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
6content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 73
 Number of unique templates used: 11

Time used to render debug report: 0.0002 secs