I have a custom implementation of Drupal and Search API Solr where I use the schema_extra_fields.xml file to add custom fields to Solr. I index the data directly into Solr and consume it using Views and Facets. After updating to Solr 8.x-3.1 my view wouldn't render and I recieved the following error:

"Faceting on fulltext fields is not yet supported. Consider to add a string field to the index for that purpose."

The issue is the check for using a fulltext field only checks the first character in the field name and throws an exception if a 't' is found. The 't' is part of the naming convention when using dynamic fields to indicate various text fields. We should check the field type to make sure it is actually a text field.

Comments

simplyshipley created an issue. See original summary.

simplyshipley’s picture

I pulled the fields from the query and added a check for the string 'text' in the field type before throwing the exception.

simplyshipley’s picture

Status: Active » Needs review
mkalkbrenner’s picture

Version: 8.x-3.1 » 8.x-3.x-dev
Component: Code » Solr Document Datasources
Status: Needs review » Needs work

My first reaction was to advise you to follow our naming convention.

But if I think twice, this could be an issue for the Solr Document Data source, too.

We have more places where we rely on field prefixes that should be reviewed.

And we need to evaluate the fastest approach for field type based decisions, as the current patch seems to add overhead.

spokje’s picture

@mkalkbrenner Not trying to hijack this issue, but what is preventing the Fulltext search to work with Facets.

I've got a site where it worked with the 3.1.x branch and Solr 3.x (don't ask...)
I've upgraded to 3.1 and the mentioned exception stopped it from working. Removing the check for "t-starting-fields" made it work flawlessly again.

Now it is on very small (not much text) Entitie and I only use checkbox facets, so I might be to lucky owner of an edge case, but it _does_ work as far as I can tell.

mkalkbrenner’s picture

@Spokje it is not supported "yet". For sure Solr can handle it. But it was a trade-off for 3.x.
For full multilingual support, fulltext fields are indexed in language specific fields. In case of facets it is hard to detect which language specific fields should be considered. And the results have to be combined across languages. That's doable with Facet queries.
But so far, nobody was interested in that work, especially because there's a workaround using strings.

spokje’s picture

@mkalkbrenner Thanks for the explanation, I kinda figured/hoped it was something along those lines.

  • mkalkbrenner committed c9939da on 8.x-3.x
    Issue #3061962 by mkalkbrenner: Comment why Field names that begin with...
mkalkbrenner’s picture

Version: 8.x-3.x-dev » 4.x-dev