I am having difficulty using MoreLikeThisQuery with an n-gram analyzer as its analyzer.
A test query isn't hitting any document in a unit test case.
Is there any debugging method to use to understand why there is not hit?

Because the test code uses a RAMDirectory, I cannot use Luke to see if the index was made correctly.

This is a snippet of the query code:

MoreLikeThisQuery mltQuery = new MoreLikeThisQuery(queryText, new String[] {"source"}, //TODO: Make this array constant defaultFuzzyAnalyzer, "source"); // defaultFuzzyAnalyzer is a 4-gram analyzer based on NGramTokenFilter. mltQuery.setMinTermFrequency(1); mltQuery.setMinDocFreq(1); mltQuery.setPercentTermsToMatch(threshold);mltQuery.setMaxQueryTerms(Integer.MAX_VALUE); TopDocs topDocs = indexSearcher.search(mltQuery, max);



Thanks.

TK

Reply via email to