You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dabboo <ag...@sapient.com> on 2009/04/06 07:26:51 UTC

Pass Double Quotes using SolrJ

Hi,

I want to pass double quotes to my solr from the front end, so that it can
return the specific results of that particular phrase which is there in
double quotes. 

If I use httpClient, it doesnt allow me to send the query in this format. As
it throws me an invalid query exception. 

I want to know, if I can do this with SolrJ Client. If yes, can somebody
please let me know as how SolrJ is doing this and parsing this type of
query.

Thanks,
Amit Garg
-- 
View this message in context: http://www.nabble.com/Pass-Double-Quotes-using-SolrJ-tp22902404p22902404.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Pass Double Quotes using SolrJ

Posted by dabboo <ag...@sapient.com>.
My application is using the httpclient. I will have to replace this from
solrj client.

But do Solrj client supports passing query with double quotes in it.

like 
?q="Glorious Revolution"&qt=dismaxrequest

Thanks,
Amit Garg

Shalin Shekhar Mangar wrote:
> 
> On Mon, Apr 6, 2009 at 10:56 AM, dabboo <ag...@sapient.com> wrote:
> 
>>
>> I want to pass double quotes to my solr from the front end, so that it
>> can
>> return the specific results of that particular phrase which is there in
>> double quotes.
>>
>> If I use httpClient, it doesnt allow me to send the query in this format.
>> As
>> it throws me an invalid query exception.
>>
>> I want to know, if I can do this with SolrJ Client. If yes, can somebody
>> please let me know as how SolrJ is doing this and parsing this type of
>> query.
>>
>>
> Amit, look at
> http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Charactersfor
> the list of characters that need to be escaped. Look at
> ClientUtils.escapeQueryChars() method in Solrj. I'm curious to know why
> you
> are trying to roll your own solr client when Solrj exists?
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Pass-Double-Quotes-using-SolrJ-tp22902404p22912443.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Pass Double Quotes using SolrJ

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Apr 6, 2009 at 10:56 AM, dabboo <ag...@sapient.com> wrote:

>
> I want to pass double quotes to my solr from the front end, so that it can
> return the specific results of that particular phrase which is there in
> double quotes.
>
> If I use httpClient, it doesnt allow me to send the query in this format.
> As
> it throws me an invalid query exception.
>
> I want to know, if I can do this with SolrJ Client. If yes, can somebody
> please let me know as how SolrJ is doing this and parsing this type of
> query.
>
>
Amit, look at
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Charactersfor
the list of characters that need to be escaped. Look at
ClientUtils.escapeQueryChars() method in Solrj. I'm curious to know why you
are trying to roll your own solr client when Solrj exists?

-- 
Regards,
Shalin Shekhar Mangar.