1
votes

I'm experiencing an issue regarding Solr facets. I have configured my schema.xml so I have two fields (STRASSE_s and facet_strasse, as well as copyfield, since the STRASSE_s field, being of type text gets processed and those processed facets results are returned (chopped, splitted strings)):

<field name="STRASSE_s" type="text" indexed="true" stored="true" multiValued="false" />
<field name="facet_strasse" type="string" indexed="true" stored="false" multiValued="false" />

<copyfield source="STRASSE_s" dest="facet_strasse" />

I want to create a Solr query, to get all different addresses, matching certain pattern. I tried to achieve that with request below (all addresses containing 'dis'). I'm using facet_strasse as a facet field to get entire text, not the one being chopped and splitted by Solr.

http://localhost:9001/solr/my_core/select?q=STRASSE_s%3Adis*&rows=0&facet=true&facet.field=facet_strasse&facet.limit=10&wt=json&indent=true

The result I receive is that there are certain addresses, but I don't get the list of facets (empty)! Screenshot

On the other hand, if I use STRASSE_s as a facet field, I do get the collection of the facets as here

Can you tell me what am I missing and how can I achieve to get actual list of facets, with entire street text?

[EDIT] My guess is that copyfield function isn't performed correctly, since there seems to be no values in destination field (facet_strasse), but not sure why.

Thanks, Lazar

1
I tried the suggested approach with multi-value field, but it doesn't solve the issue. I guess that since STRASSE_s is not multivalue field, it isn't needed to define copyfield destination (facet_strasse) to be multivalued neither, as it has only 1 value for a specific document.lazard

1 Answers

0
votes

It looks like the issue is with facet_strasse field definition, set the multi-valued to true in facet_strasse then issue would be resolved :)

<field name="facet_strasse" type="string" indexed="true" stored="false" multiValued="true" />

Read more about copy field on solr wiki copy field.