Support external-id and edtf property types for faceted search#281
Conversation
Fixes #276 Both external-id and edtf properties use StringValue internally, so the DataValueTranslator already handles their values. The missing piece was that these datatype IDs were not included in the match statements of SearchIndexFieldsBuilder and ListFacetQueryBuilder, causing their facets to be silently ignored. With this change, both types are indexed as keywords and supported for list facets. Range facets for edtf are not yet supported, as that would require converting EDTF strings to dates at index time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #281 +/- ##
=========================================
Coverage 74.07% 74.07%
Complexity 399 399
=========================================
Files 47 47
Lines 1292 1292
=========================================
Hits 957 957
Misses 335 335 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
14b74ba to
9588c5f
Compare
- Use per-matrix search engine images: Elasticsearch 7.10 for REL1_43–REL1_45, OpenSearch 1.3 for master (CirrusSearch dropped Elasticsearch support on master) - Handle MW master's removal of tests/phpunit/phpunit.php by falling back to composer phpunit - Download phpunit.xml.template in install script since GitHub tarballs exclude it via .gitattributes export-ignore - Stop using removed SpecialPageTestBase, extend MediaWikiIntegrationTestCase directly - Pass PageIdentity instead of LinkTarget to getRevisionByTitle (deprecated since MW 1.36, enforced on master) - Bump cache key version and mark master as non-experimental Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9588c5f to
bc19792
Compare
|
@SvenLieber @physikerwelt could you give this a try and see if it works well for you? |
|
@JeroenDeDauw would you expect that we have to recreate the index to test this? |
|
@physikerwelt yes, you'll have to rebuild, or wait for values to slowly appear as their indexing is triggered by edits to items. Thanks for testing. Looks like you verified external-id works. What about EDTF? |
|
Sorry, I did not test that. |
|
The recreation of the index makes testing (in our environment) a bit painful. to ? |
|
No idea |
|
Thanks a lot for adding this functionality. Both The only issue is, for EDTF, range search does not work. I assumed this was expected, since you've mentioned in the commit that: |
|
That's right, the EDTF string are stored. Would it be better to store a numeric timestamp so you can do range searches? We do that in Wikibase RDF for EDTF values: we turn the EDTF into a standard timestamp, but the downside there is that information and precision are lost. It's especially awkward for ranges. For the RDF can we solved that by exporting both the lower and upper bound of a range. |
|
Maybe the improvement of EDTF can be a seperate issue? When working with BibTeX data, you become used to queries like |
|
@JeroenDeDauw Thanks for addressing the issue, @gcgbarbosa verified that it works for EDTF and external identifiers. I agree with @physikerwelt , the range query can be another issue if it is not a priority for them. This can then be addressed in the future if it becomes a priority for one of the customers. |
|
A follow-up issue for an EDTF-specific UI that allows range queries seems sensible, yes. Feel free to file it. |

Fixes #276
Summary
Faceted search fix: Both
external-idandedtfproperties useStringValueinternally, sothe
DataValueTranslatoralready handles their values. The missing piece was that these datatype IDswere not included in the match statements of
SearchIndexFieldsBuilderandListFacetQueryBuilder,causing their facets to be silently ignored. Range facets for EDTF are not yet supported (follow-up).
CI fix: Update CI for MW master compatibility — use OpenSearch 1.3 instead of deprecated
Elasticsearch 7.10, handle removal of
tests/phpunit/phpunit.php, downloadphpunit.xml.templateexcluded from tarballs, and stop using removed
SpecialPageTestBase. MW master remains experimentaldue to upstream deprecation warnings in
RevisionStore.