Hello All,

I am new user to solr and using solr 5.2.0 setup. I am trying to create
multiple types of facets on same field. I am filtering the facets by using "
*facet.contains*". The following is the data into field.

roles : {
     "0/Student Name/",
     "1/Student Name/1000/",
     "0/Center Name/",
     "1/Center Name/1000/"
}

I am trying to add facet field like following:

query.addFacetField("{!ex=role"+i+" key=role"+i+"
facet.contains=/"+roleType+"/}roles");

where, roleType is iterated and it contains values "Student Name", "Center
Name" etc. and value of i is 1.

But I am getting error as:

org.apache.solr.search.SyntaxError: Expected identifier at pos 63
str='{!key=role1 facet.contains=/Student Name/}roles'

It works nicely if there is no any space in the string. i.e. if I index doc
as "1/StudentName/1000/".

It would be great help if somebody helps me out in this issue. Please
replay if I am missing something in this. Or point me to best practice of
doing hierarchical faceting in solr.

Thanks in advance.

Thanks & Regards,
--
Pritam Kute

Reply via email to