Closed (fixed)
Project:
Apache Solr Statistics
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2010 at 04:12 UTC
Updated:
19 Oct 2011 at 14:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
janusman commentedI like the idea of a block!
Here's a patch to start things off, and a screenshot as to how it looks. (code will report the top 25 terms within the report span, but my current test environment didn't have too much data on it) =)
Comment #2
bennos commentedfor a first overview this is great.
To improve the quality of searching, it is usefull to have more detailed list with keys, suggested keys.
Reporting is always good.
Comment #3
janusman commentedWhen you mention "suggested keys", you mean you want a rundown of the most-suggested replacements?
Like:
--------------------------------------------------
Top suggested keywords: test (55), thing (32)
--------------------------------------------------
Or would you like to know what the original keyword AND the suggestions were:
--------------------------------------------------
Top suggestions:
* testing => test (55)
* thong => thing (32)
--------------------------------------------------
Comment #4
janusman commentedOh another thing the patch is for tallying WORDS instead of phrases; maybe it might be best to use search phrases instead.
Meaning, if a user typed in "books about testing" right now I'm tallying 3 separate words: "books", "about" and "testing", but it might be better to tally the whole phrase.
Comment #5
janusman commentedOk, I'm still missing how the search suggestions should be tracked, for now I committed the attached patch to 6.x-1.x-DEV that provides basic tracking of search phrases:
Leaving open for discussing tracking of suggestion keywords.
Comment #6
bennos commentedwill try the patch.
Or would you like to know what the original keyword AND the suggestions were:
--------------------------------------------------
Top suggestions:
* testing => test (55)
* thong => thing (32)
--------------------------------------------------
this would be better, because the typing mistakes are showed. If there are several misstakes, we can improve the solr index.
Comment #7
bennos commentedHi
have installed the Dev version for some time. currently it is a good starting point.
Comment #8
geerlingguy commentedSubscribe. I'll download -dev and try it out soon.
Comment #9
mikebell_ commentedHere is a patch that adds a very (emphasis on very) basic block to display your sites top 10 most popular phrases.
It still needs a lot of work, but it's a starting point.
Comment #10
laroccadahouse commentedi've got this popularblock.patch running on a development site and would like to have a weighted display. is there a way of making the original top searches patch output a block as well instead of two separate functions?
Comment #11
janusman commentedI dont think we should use the exact same code, since there are differences:
- the report page is exhaustive (counts ALL search terms in the desired date range), and places a heavy(er?) load on the server, but is supposed to be viewed only by admins.
- a block would probably be requested to be rendered very often by different users, and probably doesnt need an exhaustive dataset.
So I'm thinking of a less expensive query to build the terms, sort of like this:
Working on this right now, in fact. We *definitely* also want to cache this, say, for at least 30 minutes.
Comment #12
janusman commentedPatch for review. Probably will commit this soon, would love some feedback.
Comment #13
janusman commentedCommitted to 6.x-1.x branch.
Comment #14
janusman commentedComment #15
laroccadahouse commentedThank you for the quick response. I applied your patch, no issues there, but I don't really see how this is different than the previous patch in what it outputs. But that does not mean much as I only know enough php to do damage.
I probably should have been a bit more detailed in what I am trying to get out of this block. I really like how the items display with the number for each keyword as well as varying font sizes depending on that number on the stats page.
Again thank you for your help.
Comment #16
janusman commentedI get it. Hmm, well, the *way* the results are output IMO should be by default relatively clean, and then anyone could override that look in their own theme.
The thing is: right now it's not overridable, since I just stuck all the contents into an array and just pipe it thru theme('item_list', $links);
... it'd be better to:
1) Have a function that just calculates the top words and returns a list with words and frequencies
2) have a theming function that converts the above into whatever kind of list (by default I think it could *just* be a listing, but with some added classes, and stylesheet for font size). So this function would return HTML, and could then be overridden by any theme/module.
So, marking as active again. Patches welcome!
Comment #17
laroccadahouse commentedAgreed about letting anyone override the look in their own theme. This would allow some to maintain it as just an item list and some to be more creative depending on their own uses. I am very comfortable with having the function return HTML with added classes for custom styling. I imagine something similar to the views cloud output.
Comment #18
laroccadahouse commentedany updates?
Comment #19
janusman commentedNone yet! Patches, code, coffee, chocolate, beer, etc. welcome!
Comment #20
janusman commentedI added a simple theme_ function; this is now committed in Git... hopefully the new dev version will be rolled by Drupal.org soon.
Thanks!