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 slund <sc...@gmail.com> on 2013/03/13 18:53:48 UTC

Using String Values in Solr Query Functions

A simple question based on the same problem discussed in the "Solr Grouping
and empty fields" topic.

It would seem that using
group.func=if(exists(groupField),groupField,uuidField) would allow us to
only group documents when we know the group field value, and solve the issue
given in the above topic.

However, it only works if groupField and uuidField are both numeric. If they
are strings (like in my application) I get an unsupported operation error.

If I use group.func=groupField then everything works, even though groupField
is a string type. Is there a reason that the IF function assumes that what
it returns is a number? I am considering trying to just change the
implementation of IF so I can make this work, but I am rather new to Solr so
I wanted see what I might be missing.

Thanks!
- Scott

For completeness:

- I can't use the solution mentioned earlier because I would have to create
hundreds of needless copy fields.
- A full query string example is:
q=*%3A*&group=true&group.facet=true&group.func=if(exists(groupField),groupField,uuidField)&rows=10&wt=xml
- I am using Solr 4.0.0



--
View this message in context: http://lucene.472066.n3.nabble.com/Using-String-Values-in-Solr-Query-Functions-tp4047108.html
Sent from the Solr - User mailing list archive at Nabble.com.