Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |
configuration:solr_shards [2023/10/17 12:51] – demiankatz | configuration:solr_shards [2023/10/17 12:52] (current) – [StripFields] demiankatz |
---|
If one index has a field another sharded index has not AND if this field is used in searchspecs.yaml or as a facet (in facets.ini), you might get into some trouble. In this case, any query will fail and will return no results. One solution for that is using the //StripFields// option in searches.ini (or to cut the facet from facets.ini). With //StripFields// you can remove fields defined in searchspecs.yaml from your query, if a certain shard is being used. **But be warned**: the results will be different from a query in one single shard, because the stripped field will not be used in the query. One more confusion with that: This is only true for extended search (i.e. if one uses truncation or special search operations avoiding VuFind® to use Dismax). Dismax currently does not care about missing fields and different schemas. | If one index has a field another sharded index has not AND if this field is used in searchspecs.yaml or as a facet (in facets.ini), you might get into some trouble. In this case, any query will fail and will return no results. One solution for that is using the //StripFields// option in searches.ini (or to cut the facet from facets.ini). With //StripFields// you can remove fields defined in searchspecs.yaml from your query, if a certain shard is being used. **But be warned**: the results will be different from a query in one single shard, because the stripped field will not be used in the query. One more confusion with that: This is only true for extended search (i.e. if one uses truncation or special search operations avoiding VuFind® to use Dismax). Dismax currently does not care about missing fields and different schemas. |
| |
To avoid that kind of trouble, you could consider to use sharding in a different way and to split shard results into separate tabs (each tab containing a result from only one shard). Or you could make all indices involved in sharding completely similarly structured. One useful strategy for allowing flexibility without creating incompatible schemas is to use dynamic field definitions for custom fields. As of version 1.3, VuFind® includes several dynamic field types by default -- see [[http://vufind.org/jira/browse/VUFIND-480|VUFIND-480]]. | To avoid that kind of trouble, you could consider to use sharding in a different way and to split shard results into separate tabs (each tab containing a result from only one shard). Or you could make all indices involved in sharding completely similarly structured. One useful strategy for allowing flexibility without creating incompatible schemas is to use [[development:architecture:solr_index_schema#dynamic_field_suffixes|dynamic field definitions]] for custom fields. |
| |
==== Sorting ==== | ==== Sorting ==== |