Re: irrelevant search results - encode issue.

2009-05-16 Thread Shalin Shekhar Mangar
On Fri, May 15, 2009 at 9:16 PM, Radha C. cra...@ceiindia.com wrote:


 I found the why it is returning irrelevant documents. I am encoding my
 query
 string with UTF-8 and appending to url as follows so it fails.
 This is the query string = art_id:queryTextstart=0rows=10sort=score
 desc
 encoded url :

 http://localhost:8983/solr/TeamSite/select?q=art_id%3A183702815%26start%3D0%
 26rows%3D10%26sort%3Dscore+deschttp://localhost:8983/solr/TeamSite/select?q=art_id%3A183702815%26start%3D0%%0A26rows%3D10%26sort%3Dscore+desc


You do not need to encode the url parameter names themselves. You only need
to encode the parameter values (i.e. after the equals operator). Using UTF-8
encoding is fine.

So the correct url will look like the following:
q=art_id:queryTextstart=0rows=10sort=score desc

-- 
Regards,
Shalin Shekhar Mangar.


RE: irrelevant search results - encode issue.

2009-05-16 Thread Radha C.
Thanks shalin.. that works...

  _  

From: Shalin Shekhar Mangar [mailto:shalinman...@gmail.com] 
Sent: Saturday, May 16, 2009 11:47 AM
To: solr-user@lucene.apache.org; cra...@ceiindia.com
Subject: Re: irrelevant search results - encode issue.


On Fri, May 15, 2009 at 9:16 PM, Radha C. cra...@ceiindia.com wrote:



I found the why it is returning irrelevant documents. I am encoding my query
string with UTF-8 and appending to url as follows so it fails.
This is the query string = art_id:queryTextstart=0rows=10sort=score desc
encoded url :
http://localhost:8983/solr/TeamSite/select?q=art_id%3A183702815%26start%3D0%
http://localhost:8983/solr/TeamSite/select?q=art_id%3A183702815%26start%3D0
%%0A26rows%3D10%26sort%3Dscore+desc 
26rows%3D10%26sort%3Dscore+desc



You do not need to encode the url parameter names themselves. You only need
to encode the parameter values (i.e. after the equals operator). Using UTF-8
encoding is fine.

So the correct url will look like the following:
q=art_id:queryTextstart=0rows=10sort=score desc

-- 
Regards,
Shalin Shekhar Mangar.



RE: irrelevant search results - encode issue.

2009-05-15 Thread Radha C.


Hi,

I found the why it is returning irrelevant documents. I am encoding my query
string with UTF-8 and appending to url as follows so it fails.
This is the query string = art_id:queryTextstart=0rows=10sort=score desc
encoded url :
http://localhost:8983/solr/TeamSite/select?q=art_id%3A183702815%26start%3D0%
26rows%3D10%26sort%3Dscore+desc 

If I access the URL directly without encoding and it is working fine. But
this will not work through application. 
I need to encode the url otherwise it will throw Illegal URI exception.

I tried ISO encode. but no luck.

Anybody has any idea. How to resolve this issue. Any help will be
appriciated. Thanks in advance.


Thanks,
Radha.C

-Original Message-
From: Radha C. [mailto:cra...@ceiindia.com] 
Sent: Friday, May 15, 2009 8:57 PM
To: solr-user@lucene.apache.org
Subject: irrelevant search results

Hello List,
 
I am having the below query
 
art_id:queryTextstart=0rows=10sort=score desc and this should not yield
any result because art_id  contains numbers.
 
But when I execute this search , it returns more than 100 documents. the
art_id field is String in schema.xml
 
Can anyone tell me how it works. What is thw wrong in the above query.
 
Thanks,
Radha.C