I’m not sure I understand your “specification.” It appears to be “capture the subdirectory path (docs/word or docs/ppt) in the DocumentRoot and redirect to docs/subdirectory/all-ind.php with a query string which does not have a key.” It makes no sense to me!
Would you please provide a logical “specification” which includes examples of test URIs?
(.*) will not capture word or ppt (it’ll capture docs/word or docs/ppt) so that’s the first thing incorrect in your code.
The second thing is that you’re redirecting to docs/{word or ppt}/all-ind.php - what good does that do if the path does not exist?
To capture the subdirectory (word or ppt) of docs and redirect to docs/all-ind.php?type={word or ppt},
RewriteEngine on
RewriteRule ^docs/(word|ppt)/index\\.php$ docs/all-ind.php?type=$1 [R=301,L]
# remove the R=301 and comma if you do not want the redirection to show.