我需要使用 spring data solr 搜索忽略大小写的关键字并包含带有方法名称的关键字。像这样
Page<SolrModel>findByNameIgnoreCaseAndContaining(@Boost(2) String name, Pageable pageable);
但它不起作用。它的工作原理是这样的
Page<SolrModel>findByNameIgnoreCase(@Boost(2) String name, Pageable pageable);
。
就像这样
Page<SolrModel>findByNameContaining(@Boost(2) String name, Pageable pageable);
。
但是我需要使用忽略大小写并包含两者来查找关键字,我该怎么做?
最佳答案
如果你颠倒包含
和ignorecase
并删除和
,它就会起作用:
Page<SolrModel> findByNameContainingIgnoreCase(@Boost(2) String name, Pageable pageable);
关于java - 如何在 spring data solr 中搜索关键字作为忽略大小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37973853/