If you want to treat commas as spaces, one quick and dirty way of doing that is this:
s/,/, /g Do that to the query string before you send it to Solr and you are done. :) Otis ---- Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch Hadoop ecosystem search :: http://search-hadoop.com/ ----- Original Message ---- > From: Kevin Penny <kpe...@jobs2web.com> > To: solr-user@lucene.apache.org > Sent: Fri, March 5, 2010 3:02:22 PM > Subject: Comma delimited Search Strings for Location Data > > Hello - > > article Background: (on solr > 1.3) > > We're doing a similar thing with our location data - however we're finding > that > if the 'input' string is one long string i.e.: q= > *Philadelphia,PA,19103,US* > > that we're getting *0* matches - > > Instead of relying on the application to convert the input query to : q= > *Philadelphia, PA, 19103, US* (which does work), we're hoping that there > could > be something we could apply something to the q parameter make it treat the > commas as spaces and execute the search. > > Here are the 2 results from the search: > > Mar 5, 2010 1:59:20 PM org.apache.solr.core.SolrCore execute > INFO: [geocore] webapp=/solr path=/select > params={explainOther=&fl=*,score&debug > Query=on&indent=on&start=0&q=Philadelphia,PA,19103,US&hl.fl=&qt=standard&wt=stan > dard&version=2.2&rows=10} hits=*0 *status=0 QTime=93 > > Mar 5, 2010 1:59:44 PM org.apache.solr.core.SolrCore execute > INFO: [geocore] webapp=/solr path=/select > params={explainOther=&fl=*,score&debug > Query=on&indent=on&start=0&q=Philadelphia,+PA,+19103,+US&hl.fl=&qt=standard&wt=s > tandard&version=2.2&rows=10} hits=*174736* status=0 QTime=406 > > And the second query's debug output: > > 2.1785781 = (MATCH) product of: > 2.9047709 = (MATCH) sum of: > 2.59102 = (MATCH) weight(text:philadelphia in 102623), product of: > 0.5993686 = queryWeight(text:philadelphia), product of: > 9.781643 = idf(docFreq=27, numDocs=182380) > 0.061274834 = queryNorm > 4.322916 = (MATCH) fieldWeight(text:philadelphia in 102623), product of: > 1.4142135 = tf(termFreq(text:philadelphia)=2) > 9.781643 = idf(docFreq=27, numDocs=182380) > 0.3125 = fieldNorm(field=text, doc=102623) > 0.29292774 = (MATCH) weight(text:pa in 102623), product of: > 0.23966041 = queryWeight(text:pa), product of: > 3.9112372 = idf(docFreq=9922, numDocs=182380) > 0.061274834 = queryNorm > 1.2222617 = (MATCH) fieldWeight(text:pa in 102623), product of: > 1.0 = tf(termFreq(text:pa)=1) > 3.9112372 = idf(docFreq=9922, numDocs=182380) > 0.3125 = fieldNorm(field=text, doc=102623) > 0.02082298 = (MATCH) weight(text:us in 102623), product of: > 0.063898034 = queryWeight(text:us), product of: > 1.0428104 = idf(docFreq=174736, numDocs=182380) > 0.061274834 = queryNorm > 0.32587826 = (MATCH) fieldWeight(text:us in 102623), product of: > 1.0 = tf(termFreq(text:us)=1) > 1.0428104 = idf(docFreq=174736, numDocs=182380) > 0.3125 = fieldNorm(field=text, doc=102623) > 0.75 = coord(3/4) > > > -- > * Kevin Penny */(e) /** | Application > Architect/Team Lead > > ________________________________________________________________________________________________________________** > > * > > * > > *Jobs2Web Inc. * | 10901 Red Circle Drive Suite 200 | Minnetonka, > MN > 55343 > * p: * 952-697-2949 | *c:* 952-807-3358 | *f:* 952-400-5676 > > */CONFIDENTIAL COMMUNICATION > /*/This message (which includes any attachments) is intended only for the > designated recipient(s). It may contain confidential or proprietary > information. If you are not a designated recipient, you may not review, use, > copy or distribute this message. If you received this in error, please > notify > the sender by reply email and delete this message and all attachments, > including > any copies thereof. Thank you/