public class ComplexPhraseIndexUpdateTrigger : AbstractIndexQueryTrigger
{
public override Lucene.Net.Search.Query ProcessQuery(string indexName, Lucene.Net.Search.Query query, Raven.Abstractions.Data.IndexQuery originalQuery)
{
var cpqp = new ComplexPhraseQueryParser(Lucene.Net.Util.Version.LUCENE_29, "Description", new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
var q = cpqp.Parse(originalQuery.Query);
return q;
}
}
Unfortunately wildcard phrase queries aren't processed correctly. What seems to happen is that in Lucene.Net.Index.DirectoryReader.MultiTermEnum the IndexReader[] array passed to the constructor is empty. I think this is the method where the wildcard term prefix is supposed to get queried against the index to identify matching expansions of the term. However, because readers.Length == 0 the code that does so never gets run. As a result, a query for "labrador ret*" ends up coming back as a boolean query for "labrador" and "Dummy clause because no terms found - must match nothing" (ComplexPhraseQueryParser, ~ line 267). Does anyone have any ideas why this might be happening?