我在 Solr 中存储以下文档:
doc {
id: string; // this is a unique string that looks like an md5 result
job_id: string; // this also looks like an md5 result -- this is not unique
doc_id: number; // this is a long number -- this is not unique
text: string; // this is stored, indexed text -- this is not unique
}
现在我要做的是计算其中包含文本 foo 的文档(doc_id)的数量。所以如果这是 SQL,我想发出这样的问题:
SELECT count(distinct doc_id)
FROM Doc
WHERE text like '%foo%';
提前致谢。