Bill - there is already a method in VuFind to do this - but please feel free to enhance it.

The code is in vufind/web/sys/Solr.php

The buildQuery method strips invalid characters.  The tokenizeInput determines how to tokenize the user input.  The validateInput method ensures the search query is structured correctly.

Andrew


On Wed, Dec 17, 2008 at 2:09 PM, Bill Dueber <bill@dueber.com> wrote:
Hey all. Before embarking on it myself, I thought I'd see if anyone else had code to clean up search strings before sending them to solr.

I've run into a bunch of these when blindly sending searches typed into our current catalog into vufind during load testing. For example, anything with a bare '+' or '-'  (e.g., "bill + dueber") will throw an error (which vufind then fails to catch, but that's a different issue...)

So...anyone?

--
Bill Dueber
Library Systems Programmer
University of Michigan Library

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Vufind-tech mailing list
Vufind-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-tech