Search Spring数据-@TextIndexed-exclude属性
我的Spring Data/MongoDB应用程序中有以下文档Search Spring数据-@TextIndexed-exclude属性,search,spring-data,spring-data-mongodb,Search,Spring Data,Spring Data Mongodb,我的Spring Data/MongoDB应用程序中有以下文档 @Document public class DocumentFile { @Id private String id; @TextIndexed private List<DocumentFileVersion> documentFileVersions; ... } 文档文件包含在项目中。 我现在的问题是,如果我搜索项目名称,也会找到DocumentFiles,因为它们的
@Document
public class DocumentFile {
@Id
private String id;
@TextIndexed
private List<DocumentFileVersion> documentFileVersions;
...
}
文档文件
包含在项目中。
我现在的问题是,如果我搜索项目名称,也会找到DocumentFile
s,因为它们的项目名称包含在字段DocumentFile\DocumentFileVersions\filePath
我现在的问题是,如果
DocumentFileVersion
在您的控制下,是否有可能从@textfindexed
中排除filePath
字段,然后,您可以只将@textfindexed
添加到DocumentFileVersion
中您只想索引的那些属性中,而不包括filePath
另一种方法是通过IndexOperations
手动设置索引。也许你想看看这张照片
public class DocumentFileVersion {
private String filePath; // contains project name
...
}