Very odd. I just started up my Windows VuFind test system and turned on stats, and it works fine there as well... and I get exactly the same debug info as you, right down to the Notice.
What version of Solr are you running? You can find out here:
http://localhost:8080/solr/stats/admin/registry.jsp
I'm currently using 1.4.1, but if you have an old enough version of VuFind, you might have plain old 1.4. If you want something new to try, it might be worth upgrading to 1.4.1 (you can just replace the solr.war file and reindex your records, and everything else should work the same).
One other thought: have you made any changes to your solr/stats/conf/solrconfig.xml file? I'm running with the out-of-the-box configuration and it seems to be fine, though I think some Windows users tend to change the paths to be absolute since the default relative paths can cause unpredictable results depending on where you run the VuFind startup script. In any case, I don't think you're running into a path problem, but it never hurts to double-check.
Good luck, and let me know if you end up stumped again... I'll try to continue thinking about this, so maybe I'll have more ideas if you remind me in the near future.
- Demian
> -----Original Message-----
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Wednesday, October 20, 2010 4:59 PM
> To: Demian Katz; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> Demian,
> So I deleted my stats index and restarted apache and that recreated the
> empty index (which shows it is actually working somewhat) but that
> didn't fix the problem.
>
> A search for "dog" output this on the bottom of my debug section:
> ----
> <br />
> <b>Notice</b>: Undefined offset: 1 in
> <b>C:\vufind\web\sys\SolrStats.php</b> on line <b>134</b><br />
> <pre>Add Record</pre>
> <pre>POST: http://localhost:8080/solr/stats/update/XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <add><doc><field name="phrase">dog</field><field
> name="type">AllFields</field><field
> name="id">4cbf57048e9850.04695675</field><field
> name="datestamp">2010-10-20T16:54:28Z</field><field
> name="browser">Other</field><field
> name="ipaddress">10.206.22.15</field><field
> name="url">/catalog/Search/Results?lookfor=dog&type=AllFields</fiel
> d
> ></doc></add>
> </pre>
> <pre>Commit</pre>
> <pre>POST: http://localhost:8080/solr/stats/update/XML:
> <commit/></pre>
> ----
>
> Which all looks good other than the undefined offset warning.
>
> Line 134 of my SolrStats.php is the section on browser types:
> 132// Build new return array
> 133 $info = array('browser' => $product[0],
> 134 'browserVersion' => $product[1],
> 135 'system' => $system);
> 136 return $info;
>
> I'm still lost on this one. It's weird how it doesn't work.
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiative
> Paul Smith's College
> 518.327.6376
> mbeccaria@...
> Become a friend of Paul Smith's Library on Facebook today!
>
> -----Original Message-----
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Wednesday, October 20, 2010 3:29 PM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> Very strange. I don't see anything obviously wrong with your examples,
> and I just turned on stats on my test server without any trouble.
> Nothing has changed in the stats code in a long time, so I'm not aware
> of any particular bug that is likely to affect you.
>
> A couple thoughts for starters:
>
> 1.) If you turn on debug in config.ini, you should see some information
> when your statistics are saved. For example, mine looks like:
>
> <pre>Add Record</pre>
> <pre>POST: http://localhost:8082/solr/stats/update/XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <add><doc><field name="phrase">dogs</field><field
> name="type">AllFields</field><field name="noresults">T</field><field
> name="id">4cbf42b054aae4.06897052</field><field
> name="datestamp">2010-10-20T15:27:44Z</field><field
> name="browser">Other</field><field
> name="ipaddress">153.104.2.56</field><field
> name="referrer">https://vu61162.villanova.edu/Find/Search/Results?lookf
> o
> r=test&type=AllFields&submit=Find</field><field
> name="url">/Find/Search/Results?lookfor=dogs&type=AllFields&sub
> m
> it=Find</field></doc></add>
>
> </pre>
> <pre>Commit</pre>
> <pre>POST: http://localhost:8082/solr/stats/update/XML:
> <commit/></pre>
>
> If you turn on debug, are you seeing similar lines? Are the URLs in
> the
> lines appropriate?
>
> 2.) Is it possible that your Solr index files have gotten corrupted?
> Have you tried deleting the solr/stats/index directory and restarting
> VuFind to see if that clears anything up?
>
> - Demian
>
> ________________________________________
> From: Michael Beccaria [mbeccaria@...]
> Sent: Wednesday, October 20, 2010 2:08 PM
> To: vufind-general@...
> Subject: Re: [VuFind-General] Usage Statistics
>
> So I know this was an old issue, but I got sidetracked last time I was
> looking into this before solving it. My statistics aren't updating, and
> never have. I'm running an oldish version of vufind (post 1.0 though)
> but one that is supposed to have stats working.
>
> In /web/sys/Solr.php I echoed the $xml string from the _update method
> and got this (which looks normal):
> <add><doc><field name="phrase">dog</field><field
> name="type">AllFields</field><field
> name="id">4cbf2713e50276.82156046</field><field
> name="datestamp">2010-10-20T13:29:55Z</field><field
> name="browser">Other</field><field
> name="ipaddress">10.206.22.15</field><field
> name="url">/catalog/Search/Results?lookfor=dog&type=AllFields</fiel
> d
> ></doc></add><commit/>
>
> However, if I echo the "$responseCode =
> $this->client->getResponseCode();" I get 400400, which is an http error
> code.
>
> So I tried to dig a little deeper and commit this record to solr on its
> own on the server. Here's what I have found:
> On my server, this url (built from the solr docs as an example):
> http://localhost:8080/solr/stats/update?commit=true -H "Content-Type:
> text/xml" --data-binary '<add><doc><field
> name="phrase">dog</field><field name="type">AllFields</field><field
> name="id">4cbf2713e50276.82156046</field><field
> name="datestamp">2010-10-20T13:29:55Z</field><field
> name="browser">Other</field><field
> name="ipaddress">10.206.22.15</field><field
> name="url">/catalog/Search/Results?lookfor=dog&type=AllFields</fiel
> d
> ></doc></add><commit waitFlush="false" waitSearcher="false"/>'
>
> Returns this xml:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">31</int>
> </lst>
> </response>
>
> Which looks ok, but nothing got added to my stats index. I have numDocs
> : 0, maxDoc : 0 and under the update handlers section I have commits:
> 2,
> add: 0. I can't seem to get a document to get added to my solr stats
> index for some reason. I double checked that the field names in the xml
> match the field names in the schema.xml and that the status of the
> stats
> solr server is good. I'm running out of ideas on this one. Anyone have
> any?
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiative
> Paul Smith's College
> 518.327.6376
> mbeccaria@...
> [cid:image002.png@... href="http://www.facebook.com/psclibrary" target="_new">http://www.facebook.com/psclibrary
> >
> Become a friend of Paul Smith's
> Library<http://www.facebook.com/psclibrary> on Facebook today!
>
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Friday, January 15, 2010 11:16 AM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> Glad to hear that things are working better now!
>
> And yes, stats should appear immediately -- the SolrStats class issues
> a
> commit every time it adds something to the index. That may or may not
> be wise from a performance perspective (this feature isn't heavily used
> or deeply developed and may well need some tweaking), but it should
> give
> you instant gratification.
>
> - Demian
>
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Friday, January 15, 2010 11:06 AM
> To: Demian Katz; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> Demian,
> That did the trick for the stats page loading. Thanks! This leads me to
> my prior question: Are stats supposed to load on-the-fly? When I do
> searches should those numbers update right away?
> Thanks,
> Mike
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiatives
> Paul Smith's College
> 518.327.6376
> [cid:image003.jpg@...]
> PSC appreciates your feedback regarding our customer service.
> Please take a moment to Tell us your
> Experience!<http://www.surveymonkey.com/s/TPXHJG8>
>
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Friday, January 15, 2010 10:49 AM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> I think I've found it -- there was a bug that I thought got fixed
> before
> the release of RC2, but which actually seems to have happened shortly
> AFTER the release. Go to the __construct() method of the Solr class in
> web/sys/Solr.php, and change this line:
>
> $index = $index != "" ? $index :
> isset($configArray['Index']['default_core']) ?
> $configArray['Index']['default_core'] : "biblio";
>
> to:
>
> // Set a default Solr index if none is provided to the
> constructor:
> if (empty($index)) {
> $index = isset($configArray['Index']['default_core']) ?
> $configArray['Index']['default_core'] : "biblio";
> }
>
> That should solve the problem. Sorry for the run-around!
>
> - Demian
>
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Friday, January 15, 2010 10:40 AM
> To: Demian Katz; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> I made the changes to Statistics.php (which made sense) and then set
> debug to true. Below is a link to my debug screenshot which is
> (strangely) still showing queries being sent to the biblio index (and
> which causes errors when I change the stats solr property in config. I
> should also note that my stats index is empty. I have never had data
> written to it. I will try to track this down some more, but I am still
> unsure how it is supposed to work. On searches and record views is
> vufind supposed to write data to the stats index?
>
> http://screencast.com/t/N2IwZGNhMDg
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiatives
> Paul Smith's College
> 518.327.6376
> [cid:image003.jpg@...]
> PSC appreciates your feedback regarding our customer service.
> Please take a moment to Tell us your
> Experience!<http://www.surveymonkey.com/s/TPXHJG8>
>
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Friday, January 15, 2010 9:52 AM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: [VuFind-General] Usage Statistics
>
> Your observation that things seem to be working on the writing end in
> the Search and Record modules but failing on the reading side in the
> Admin module led me to look more closely at the code. I discovered an
> inconsistency -- we write to the index using a custom SolrStats class,
> but we read from the index using the standard Solr class. For a
> default
> setup, this shouldn't make a difference, but if you point the stats and
> index to different Solr instances, it will cause trouble.
>
> I've patched the problem in the trunk in r2112. The attached patch
> shows my changes. They're very simple and should apply cleanly to RC2
> even if you're not using the latest trunk code.
>
> Please give this a try and let me know if it solves your problems. If
> nothing else, it should put you on more consistent ground for further
> debugging.
>
> - Demian
>
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Friday, January 15, 2010 9:01 AM
> To: vufind-general@...
> Subject: Re: [VuFind-General] Usage Statistics
>
> Thanks for the feedback.
>
> I'm getting solr error's:
> It seems to be querying biblio instead of the stats index because I
> getting undefined field errors for "phrase" and "ipaddress". These
> fields are not found in the biblio schema, but are in the stats index.
> My solr location under the [Statistics] heading is set to the default
> http://localhost:8080/solr/.
>
> I tried changing it to http://localhost:8080/solr/stats but the same
> error comes up in debug and in the tomcat logs...it seems to still be
> querying the biblio index.
>
> Also, if I enable Statistics tracking and I change the default
> statistics solr URL to something else, my search error's out and I get
> undefined field errors (same ones) in tomcat logs. According to the
> logs, it tries to query the biblio index the entire time.
>
> Not sure what's going on here, but it doesn't seem right. As an aside,
> I'm using the official solr 1.4 version, not the one that came with
> vufind. I don't think that would make a difference here, but there
> might
> be something I don't know about.
> Thanks,
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiatives
> Paul Smith's College
> 518.327.6376
> [cid:image003.jpg@...]
> PSC appreciates your feedback regarding our customer service.
> Please take a moment to Tell us your
> Experience!<http://www.surveymonkey.com/s/TPXHJG8>
>
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Thursday, January 14, 2010 12:43 PM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: Usage Statistics
>
> Some thoughts:
>
> 1.) The "translate index not found" error is a red herring. This error
> was added to help with populating the language translation files. Any
> time a string is displayed that isn't included in the web/lang/en.ini
> file, this message will be added when debug is turned on. Work is
> underway to get all strings from VuFind included in the language files
> in order to eliminate these errors, but it hasn't been completed yet.
>
> 2.) Is localhost:8080 a valid Solr server? If not, you may need to
> point the solr setting in the [Statistics] section of config.ini to a
> different URL. In most cases, this should be the same as the url
> setting in the [Index] section, though you could theoretically track
> stats in a completely separate Solr server if you wanted to.
>
> 3.) Assuming you are already pointing to the correct Solr server, it
> might be useful to access the Solr request URLs shown in the debug
> output directly to see if you can see more detailed error information.
>
> I hope this helps!
>
> - Demian
>
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Thursday, January 14, 2010 10:54 AM
> To: Demian Katz; vufind-general@...
> Subject: RE: Usage Statistics
>
> I'm getting a "translate index not found" error when trying to access
> statistics from the admin page. Stats has never worked on my install.
> The config file has default settings with availability set to true. The
> screencast shows a screenshot with debug on. Any ideas?
> http://screencast.com/t/MzBkYWUwN
>
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiatives
> Paul Smith's College
> 518.327.6376
> [cid:image003.jpg@...]
> PSC appreciates your feedback regarding our customer service.
> Please take a moment to Tell us your
> Experience!<http://www.surveymonkey.com/s/TPXHJG8>
>
> From: Demian Katz [mailto:demian.katz@...]
> Sent: Wednesday, January 06, 2010 3:44 PM
> To: Michael Beccaria; vufind-general@...
> Subject: RE: Usage Statistics
>
> Stats are turned off by default, but they should work if you set the
> "enabled" setting to true in the [Statistics] section of config.ini.
> At
> least, they were working the last time I tested them, which wasn't too
> long ago. Did you go into the admin area to see if anything was
> showing
> up? The statistics aren't too sophisticated, but you should at least
> see search terms, search terms yielding zero hits, and IDs of records
> viewed.
>
> - Demian
>
> From: Michael Beccaria [mailto:mbeccaria@...]
> Sent: Wednesday, January 06, 2010 2:54 PM
> To: vufind-general@...
> Subject: [VuFind-General] Usage Statistics
>
> Sorry for the wrong subject earlier. Repost:
> Are usage statistics enabled in Vufind? I notice a section in the
> config
> file but am not noticing an increases in the solr stats index.
>
>
> Mike Beccaria
> Systems Librarian
> Head of Digital Initiatives
> Paul Smith's College
> 518.327.6376
> [cid:image003.jpg@...]
> PSC appreciates your feedback regarding our customer service.
> Please take a moment to Tell us your
> Experience!<http://www.surveymonkey.com/s/TPXHJG8>
|