As part of #887880: First module release (meta issue) I would like to add the feature of configurable content types, i.e. allow the user to a choice of what kind of content the uniqueness search works on.
A "global setting" would probably the easiest way of implementing this, but I think this should probably be content type specific, as the setting would probably be different for each content-type (if someone enables the module on multiple content types).
I also propose to only search "the same content type" by default as that's probably what most people would expect.
For Apache Solr the search content types are currently hard-coded to types 'discussion' and 'local_discussion'.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 899489-6-content-type.patch | 8.4 KB | bforchhammer |
Comments
Comment #1
coltraneOk, how about a multi-select list on the settings page for what content can be searched? If the Uniqueness widget is enabled on a content type then it defaults to adding that type as searchable.
Comment #2
bforchhammer commentedThat would be fairly easy to implement, but consider the following scenario:
Let's say a drupal site has two content types: client and faq_question. Client is for a client directory; Faq_question is frequently asked questions, and both can be created by common users of the drupal site. So to avoid duplicate content we can activate the uniqueness module for both content types; now the way it is at the moment the uniqueness module just searches all content types, so for example when entering a title for a new client the user might also get search results for "faq_question" content which isn't really relevant in that case. (Assuming that there's similar "client" and "faq_question" content).
So in that sense maybe the best thing would be to start by only searching "the same content type" by default, so when creating a new client you only get results for content of type "client"...
On the other hand a multi-select list on the settings page would be quite appropriate if the uniqueness module is only used for one content type (or one group of related content types).
Comment #3
coltraneSure, searching the same content type is a good step for now, with potentially moving to per content type search settings.
Comment #4
bforchhammer commentedPostponed until #722118: Search method options with fallback to core search is fixed, because #722118 does some code refactoring and this issue applies to all search methods.
Comment #5
bforchhammer commented#942632: Monster issue (#4) seems to already contain parts of a solution.
Comment #6
bforchhammer commentedExtracted parts from #942632: Monster issue monster patch which
SOLR implementation is included but completely untested (coltrane?).
Comment #7
bforchhammer commentedCommited.
Solr still untested, see #1130596: Testing Apache SOLR Integration.