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 Tanu Garg <ta...@gmail.com> on 2013/09/25 12:40:29 UTC
Sum function causing error in solr
0 down vote favorite
Hi I m trying sum function in solr
val:"sum(kcmeta/bookmark/count,10.00)"
itis giving error:
<lst name="error">
<str name="msg">undefined field: "kcmeta"</str>
<int name="code">400</int>
</lst>
My field name is "kcmeta/bookmark/count"
Please suggest how to resolve this.
--
View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Tanu Garg <ta...@gmail.com>.
Yes jack. have tried this. but giving the same error.
--
View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901p4092307.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Jack Krupansky <ja...@basetechnology.com>.
Escape any special characters in field names with backslash.
-- Jack Krupansky
-----Original Message-----
From: Tanu Garg
Sent: Wednesday, September 25, 2013 8:45 AM
To: solr-user@lucene.apache.org
Subject: Re: Sum function causing error in solr
Thanks erick
I know we should name variable as java variables. But theses are the
predefined variables. I cant rename it.
Provide me the solution with this constraint.
--
View this message in context:
http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901p4091927.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Tanu Garg <ta...@gmail.com>.
Thanks erick
I know we should name variable as java variables. But theses are the
predefined variables. I cant rename it.
Provide me the solution with this constraint.
--
View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901p4091927.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Erick Erickson <er...@gmail.com>.
Don't name your fields that way. The general advice
is to only name your fields as though they were
Java variables. The field name you're using is
too easily confused with a mathematical operation
after all.
Personally, I only use lower-case, underscore, and
perhaps numbers to avoid surprises like this.
Best,
Erick
On Wed, Sep 25, 2013 at 6:40 AM, Tanu Garg <ta...@gmail.com> wrote:
> 0 down vote favorite
>
>
> Hi I m trying sum function in solr
>
> val:"sum(kcmeta/bookmark/count,10.00)"
>
> itis giving error:
>
> <lst name="error">
> <str name="msg">undefined field: "kcmeta"</str>
> <int name="code">400</int>
> </lst>
>
> My field name is "kcmeta/bookmark/count"
>
> Please suggest how to resolve this.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Tanu Garg <ta...@gmail.com>.
solr-4.3.1
--
View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901p4092342.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Yonik Seeley <yo...@lucidworks.com>.
On Fri, Sep 27, 2013 at 2:28 AM, Tanu Garg <ta...@gmail.com> wrote:
> tried this as well. but its not working.
It's working fine for me. What version of Solr are you using?
What does your complete request look like?
-Yonik
http://lucidworks.com
Re: Sum function causing error in solr
Posted by Tanu Garg <ta...@gmail.com>.
tried this as well. but its not working.
--
View this message in context: http://lucene.472066.n3.nabble.com/Sum-function-causing-error-in-solr-tp4091901p4092306.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Sum function causing error in solr
Posted by Yonik Seeley <yo...@lucidworks.com>.
On Wed, Sep 25, 2013 at 6:40 AM, Tanu Garg <ta...@gmail.com> wrote:
> My field name is "kcmeta/bookmark/count"
You can always use the "field" function to handle whacky field
names... unquoted if it's simple enough, or quoted if it's not.
field(kcmeta/bookmark/count)
or
field("kcmeta/bookmark/count")
-Yonik
http://lucidworks.com