Since we now have multiple item types per index, it would be great to also be able to see how many items of each type there are, and how many are indexed. Probably not on the normal "View" tab of the index, but either collapsed or on an extra page (linked from the "View" tab, not an extra tab or anything).

Would need an addition to the tracker plugin interface, of course.

Comments

drunken monkey’s picture

Issue tags: +release target
alan-ps’s picture

Assigned: Unassigned » alan-ps

I will look at this!

alan-ps’s picture

Assigned: alan-ps » Unassigned
Status: Active » Needs review
StatusFileSize
new4.57 KB
new37.09 KB

This is a patch. It would be great to hear your thoughts about it. We, probably, should not show "Index details per datasource" if our index is not multiple, but I'm not sure: https://www.drupal.org/files/issues/details-per-datasource.png

drunken monkey’s picture

Status: Needs review » Needs work

Good job, thanks!

However, even though this is exactly as I described it in the IS, I have some suggested improvements:

  1. Instead of making this a collapsible extra form element, maybe just display this information next to the datasources in the info table? (Perhaps in <small> tags so it doesn't draw too much attention.)
  2. To avoid "breaking" an interface this late in Beta, and to not make it compulsory for tracker plugins to provide this information (it's not really necessary, just nice to have, and this might make it harder to implement some tracker algorithms), maybe the two new methods should live on a new interface, something like TrackerPerDatasourceInterface. Then just check whether the tracker implements that before using it (and otherwise just don't provide this information).

(Also, the first sentence in a doc comment should be only one line (max. 80 characters), so maybe just lose the "for this index" part for the two new methods' comments?)

Otherwise, though, this really looks very good already, so thanks again!

alan-ps’s picture

Assigned: Unassigned » alan-ps

Thanks for your response. I will continue work with it!

alan-ps’s picture

Assigned: alan-ps » Unassigned
Status: Needs work » Needs review
Issue tags: +drupaldevdays, +DevDaysSeville
StatusFileSize
new33.36 KB
new5.36 KB
new3.89 KB

This is a new patch for reviewing!

alan-ps’s picture

StatusFileSize
new5.36 KB
new5.51 KB

Sorry, I forgot about untracked files( This is a correct patch.

drunken monkey’s picture

StatusFileSize
new1.06 KB

Sorry, should have reviewed more carefully: apparently (maybe at some point since I created this issue) getIndexedItemsCount() et al. already have $datasource_id arguments, there doesn't seem to be any need for additional methods, an additional interface and all that jazz.
Just a few lines in the theme function.

See the attached patch, and please test! (I don't have any web server running currently, so this is completely untested.)

And sorry for the confusion and unnecessary work!

alan-ps’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new29.43 KB

yep, your code looks better. I can confirm that it works fine:
https://www.drupal.org/files/issues/datasource-details-v3.png

borisson_’s picture

RTBC++

  • drunken monkey committed 6582918 on 8.x-1.x authored by alan-ps
    Issue #2343161 by alan-ps, drunken monkey: Added per-datasource indexing...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks for reviewing!
Committed.
Thanks again for your work on this, alan-ps!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.