Question

I am using Nutch and Lucene (java API) for my website keyword search . My problem is that Nutch cannot allocate all the pages that contains the desired keywords. For eg. I have the product named "Luxury Bag" and If I search with "Luxury" I don't get the product in results and if I find with "Luxury Bag" I found it . I spent over a week for this errors and no idea at all. In addition , I've tested my crawled data with Luke Program . It perfectly work with Luke but not with my java codes. Can anyone kindly suggest me . Any suggestion is welcome and appreciated . Thanks.

Was it helpful?

Solution

I just solved the problem .

Query query = Query.parse(searchQuery, conf);
QueryParams queryParams = new QueryParams();
queryParams.setMaxHitsPerDup(100);
queryParams.setNumHits(100);
query.setParams(queryParams);
Hits hits = bean.search(query);
long allResultsCount =**hits.getTotal());**

I changed this into

long allResultsCount =**hits.getLength());**
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top