我一直在尝试进行 lucene 搜索查询,其中输入“Foo B”将返回“Foo Bar”、Foo Bear、Foo Build 等,但不会返回 ID 为“Foo”和单词“Bar”的记录在说它的“描述”字段。
我已经研究过 multiphrasequery 但它从不返回任何结果,下面是我一直在尝试的
Term firstTerm = new Term("jobTitle", "Entry");
Term secondTerm = new Term("jobTitle", "Artist");
Term asdTerm = new Term(fld)
Term[] tTerms = new Term[]{firstTerm, secondTerm};
MultiPhraseQuery multiPhrasequery = new MultiPhraseQuery();
multiPhrasequery.add( tTerms );
org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery(multiPhrasequery, this.type).setSort(sort);
results = hibQuery.list();