On Mon, Aug 17, 2009 at 5:36 PM, Ensdorf Ken<ensd...@zoominfo.com> wrote:
>> Does this mean I should have converted my objects to string before
>> writing them to the server?
>>
>
> I believe SolrJ takes care of that for you by calling toString(), but you 
> would need to convert explicitly when you query (and then escape).
>

Hmmm.  It's not working right.  I've added a 5 documents, 3 with the
URL set to "http://xcski.com/pharma/"; and 2 with the URL set to
"http://xcski.com/nano/";.  Doing other sorts of queries seems to be
pulling back the right data:

 [DEBUG] 34:20 (Solr.java:getForConcept:116)
     [java] search term = fribbet, concept = pharma
     [java]
     [java] Aug 17, 2009 5:34:20 PM org.apache.solr.core.SolrCore execute
     [java] INFO: [] webapp=null path=/select
params={q=fribbet&fq=concept%3Apharma} hits=1 status=0 QTime=9
     [java] [DEBUG] 34:20 (Solr.java:getForConcept:130)
     [java] got doc SolrDocument[{id=2:http://xcski.com/pharma/,
concept=pharma, text=this is a third big long chunk of text containing
the word fribbet, title=this is the third title, keywords=pills,drugs,
origDoctype=html, chunkNum=2, url=http://xcski.com/pharma/}]

 But if I want to restrict it to a specific URL, I use

       SolrQuery query = new SolrQuery();
        query.setQuery("url:" + ClientUtils.escapeQueryChars(url));

and it's not returning anything.  Log4j output looks like:

     [java] [DEBUG] 34:20 (Solr.java:getAllForURL:89)
     [java] getting for URL: http://xcski.com/nano/
     [java]
     [java] Aug 17, 2009 5:34:20 PM org.apache.solr.core.SolrCore execute
     [java] INFO: [] webapp=null path=/select
params={q=url%3Ahttp%5C%3A%5C%2F%5C%2Fxcski%5C.com%5C%2Fnano%5C%2F}
hits=0 status=0 QTime=16
     [java] [DEBUG] 34:20 (Solr.java:main:229)
     [java] found: 0

Actually, looking at that, it looks like it's escaped the URL twice,
converting ":" into "%3A", then converting that to "%5C%3A".  Could
that be?



-- 
http://www.linkedin.com/in/paultomblin

Reply via email to