--- a/src/index/fsindexer.cpp
+++ b/src/index/fsindexer.cpp
@@ -724,9 +724,12 @@
 	    if (doc.url.empty())
 		doc.url = cstr_fileu + fn;
 	    const string *fnp = 0;
-	    if (doc.ipath.empty() &&
-                (!doc.peekmeta(Rcl::Doc::keyfn, &fnp) || fnp->empty()))
-		doc.meta[Rcl::Doc::keyfn] = utf8fn;
+	    if (doc.ipath.empty()) {
+                if (!doc.peekmeta(Rcl::Doc::keyfn, &fnp) || fnp->empty())
+                    doc.meta[Rcl::Doc::keyfn] = utf8fn;
+            } 
+            // Set container file name for all docs, top or subdoc
+            doc.meta[Rcl::Doc::keytcfn] = utf8fn;
 
 	    char cbuf[100]; 
 	    sprintf(cbuf, "%lld", (long long)stp->st_size);
@@ -811,7 +814,8 @@
 	    fileDoc.onlyxattr = true;
 	} else {
 	    fileDoc.fmtime = ascdate;
-	    fileDoc.meta[Rcl::Doc::keyfn] = utf8fn;
+	    fileDoc.meta[Rcl::Doc::keyfn] = 
+                fileDoc.meta[Rcl::Doc::keytcfn] = utf8fn;
 	    fileDoc.haschildren = true;
 	    fileDoc.mimetype = mimetype;
 	    fileDoc.url = cstr_fileu + fn;