Re: Searching for document by id in a sharded environment

2013-12-10 Thread Daniel Bryant

Thanks for your replies Ahmet and Joel!

We have now determined that the exclamation point wasn't the issues, and 
our query actually had too many boolean expressions in (more than the 
default 1024).


Apologies for any confusion this may have caused - the issue went around 
my team like the childhood game of telephone, and the initial problem of 
the too many boolean expressions was thought to have appeared due to 
the !, when in fact some other code had been committed which didn't 
batch large delete by id queries. This caused us to start looking for a 
solution to a problem that didn't exist :-)


Thanks again for the quick response!

Best wishes,

Daniel



On 09/12/2013 12:21, Ahmet Arslan wrote:

Hi Daniel,

TermQueryParser comes handy when you don't want to escape.

q = {!term 
f=id}156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475




On Monday, December 9, 2013 2:14 PM, Daniel Bryant 
daniel.bry...@tai-dev.co.uk wrote:
Hi,

I'm in the process of migrating an application that queries Solr to use
a new sharded SolrCloud, and as part of this I'm adding the shard key to
the document id when we index documents (as we're using grouping and we
need to ensure that grouped documents end up on the same shard) e.g.

156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475

I'm having a problem with my application when searching by id with SolrJ
CloudSolrServer - the exclamation point is misinterpreted as a boolean
negation, and the matching document is not returned in the search results.

I just wanted to check if the only way to make this work would be to
escape the exclamation point (i.e. prefix with a slash, or enclose the
id within quotes). We're keen to avoid this, as this will require lots
of modifications throughout the code on a series of applications that
interact with Solr.

If anyone has any better suggestions on how to achieve this it would be
very much appreciated!

Best wishes,

Daniel




--
*Daniel Bryant  |  Software Development Consultant  | www.tai-dev.co.uk 
http://www.tai-dev.co.uk/*
daniel.bry...@tai-dev.co.uk mailto:daniel.bry...@tai-dev.co.uk  |  +44 
(0) 7799406399  |  Twitter: @taidevcouk https://twitter.com/taidevcouk


Searching for document by id in a sharded environment

2013-12-09 Thread Daniel Bryant

Hi,

I'm in the process of migrating an application that queries Solr to use 
a new sharded SolrCloud, and as part of this I'm adding the shard key to 
the document id when we index documents (as we're using grouping and we 
need to ensure that grouped documents end up on the same shard) e.g.


156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475

I'm having a problem with my application when searching by id with SolrJ 
CloudSolrServer - the exclamation point is misinterpreted as a boolean 
negation, and the matching document is not returned in the search results.


I just wanted to check if the only way to make this work would be to 
escape the exclamation point (i.e. prefix with a slash, or enclose the 
id within quotes). We're keen to avoid this, as this will require lots 
of modifications throughout the code on a series of applications that 
interact with Solr.


If anyone has any better suggestions on how to achieve this it would be 
very much appreciated!


Best wishes,

Daniel


--
*Daniel Bryant  |  Software Development Consultant  | www.tai-dev.co.uk 
http://www.tai-dev.co.uk/*
daniel.bry...@tai-dev.co.uk mailto:daniel.bry...@tai-dev.co.uk  |  +44 
(0) 7799406399  |  Twitter: @taidevcouk https://twitter.com/taidevcouk


Re: Searching for document by id in a sharded environment

2013-12-09 Thread Ahmet Arslan
Hi Daniel,

TermQueryParser comes handy when you don't want to escape.

q = {!term 
f=id}156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475




On Monday, December 9, 2013 2:14 PM, Daniel Bryant 
daniel.bry...@tai-dev.co.uk wrote:
Hi,

I'm in the process of migrating an application that queries Solr to use 
a new sharded SolrCloud, and as part of this I'm adding the shard key to 
the document id when we index documents (as we're using grouping and we 
need to ensure that grouped documents end up on the same shard) e.g.

156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475

I'm having a problem with my application when searching by id with SolrJ 
CloudSolrServer - the exclamation point is misinterpreted as a boolean 
negation, and the matching document is not returned in the search results.

I just wanted to check if the only way to make this work would be to 
escape the exclamation point (i.e. prefix with a slash, or enclose the 
id within quotes). We're keen to avoid this, as this will require lots 
of modifications throughout the code on a series of applications that 
interact with Solr.

If anyone has any better suggestions on how to achieve this it would be 
very much appreciated!

Best wishes,

Daniel


-- 
*Daniel Bryant  |  Software Development Consultant  | www.tai-dev.co.uk 
http://www.tai-dev.co.uk/*
daniel.bry...@tai-dev.co.uk mailto:daniel.bry...@tai-dev.co.uk  |  +44 
(0) 7799406399  |  Twitter: @taidevcouk https://twitter.com/taidevcouk



Re: Searching for document by id in a sharded environment

2013-12-09 Thread Joel Bernstein
Daniel,

What version of Solr are you using? I'll see if I can recreate this.




On Mon, Dec 9, 2013 at 7:21 AM, Ahmet Arslan iori...@yahoo.com wrote:

 Hi Daniel,

 TermQueryParser comes handy when you don't want to escape.

 q = {!term
 f=id}156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475




 On Monday, December 9, 2013 2:14 PM, Daniel Bryant 
 daniel.bry...@tai-dev.co.uk wrote:
 Hi,

 I'm in the process of migrating an application that queries Solr to use
 a new sharded SolrCloud, and as part of this I'm adding the shard key to
 the document id when we index documents (as we're using grouping and we
 need to ensure that grouped documents end up on the same shard) e.g.

 156a05d1-8ebe-4f3c-b548-60a84d167a16!643fd57c-c65e-4929-bc0e-029aa4f07475

 I'm having a problem with my application when searching by id with SolrJ
 CloudSolrServer - the exclamation point is misinterpreted as a boolean
 negation, and the matching document is not returned in the search results.

 I just wanted to check if the only way to make this work would be to
 escape the exclamation point (i.e. prefix with a slash, or enclose the
 id within quotes). We're keen to avoid this, as this will require lots
 of modifications throughout the code on a series of applications that
 interact with Solr.

 If anyone has any better suggestions on how to achieve this it would be
 very much appreciated!

 Best wishes,

 Daniel


 --
 *Daniel Bryant  |  Software Development Consultant  | www.tai-dev.co.uk
 http://www.tai-dev.co.uk/*
 daniel.bry...@tai-dev.co.uk mailto:daniel.bry...@tai-dev.co.uk  |  +44
 (0) 7799406399  |  Twitter: @taidevcouk https://twitter.com/taidevcouk




-- 
Joel Bernstein
Search Engineer at Heliosearch