The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

ChristophK (1) [Avatar] Offline

the example given for the SpanQueryFilter is the same as the one for the QueryFilter (except for the different method name). The mistake is in Chapter 5.6.6 on page 216.

Best Regards,
mike.mccandless (221) [Avatar] Offline
Re: Error in example for SpanQueryFilter
Egads! You're right. How silly. I'll fix it... it should look like this (sorry for the loss of all whitespace):

public void testSpanQueryFilter() throws Exception {
SpanQuery categoryQuery =
new SpanTermQuery(new Term("category", "/philosophy/eastern"));

Filter categoryFilter = new SpanQueryFilter(categoryQuery);

assertEquals("only tao te ching",
TestUtil.hitCount(searcher, allBooks, categoryFilter));