It looks to me as if it's blowing up on syntax. I don't have access to the Admin UI right now, but I would suggest attempting to submit this query via the UI and examining the URL that comes back. That frequently solves my more frustrating syntax problems.
I.E. try putting the cost:[.......] in the query box on the UI (no quotes as a first try) and see what happens Alternatively, try putting cost as the query field (qf) and just the 20000 TO (2000....) in the query box... Apologies - I don't have the UI in front of me or I'd try it myself, but this is the general idea - try to issue the query in the Admin UI and observe the syntax in the URL that is returned at the top of the page along with the results. On Wed, Oct 26, 2016 at 9:00 AM, Prasanna S. Dhakephalkar < prasann...@merajob.in> wrote: > Hi, > > Thanks for reply, I did > > "q": "cost:[20000 TO (20000+5000)]" > > Got > > "error": { > "msg": "org.apache.solr.search.SyntaxError: Cannot parse 'cost:[20000 > to (20000+5000)]': Encountered \" <RANGE_GOOP> \"(20000+5000) \"\" at line > 1, column 18.\nWas expecting one of:\n \"]\" ...\n \"}\" ...\n ", > } > > I want solr to do the addition. > I tried > "q": "cost:[20000 TO (20000+5000)]" > "q": "cost:[20000 TO sum(20000,5000)]" > > I has not worked. I am missing something. I donot know what. May be how to > invoke functions. > > Regards, > > Prasanna. > > > -----Original Message----- > From: Tom Evans [mailto:tevans...@googlemail.com] > Sent: Wednesday, October 26, 2016 3:07 PM > To: solr-user@lucene.apache.org > Subject: Re: Query formulation help > > On Wed, Oct 26, 2016 at 8:03 AM, Prasanna S. Dhakephalkar < > prasann...@merajob.in> wrote: > > Hi, > > > > > > > > May be very rudimentary question > > > > > > > > There is a integer field in a core : "cost" > > > > Need to build a query that will return documents where 0 < > > "cost"-given_number < 500 > > > > cost:[given_number TO (500+given_number)] > >