2

我正在使用 solr 3.5 并在分页时遇到奇怪的行为。分页时 solr 返回了一些相同的记录/文档;例如,我在第一页得到一个文档,在第三页得到相同的文档。故障排除后,我意识到 Solr 在使用edismax查询解析器时的行为是这样的。使用默认解析器时分页效果很好。任何想法为什么?

下面是每个分页页面的解码查询

第 1 页

spellcheck=true&spellcheck.onlyMorePopular=false&spellcheck.extendedResults=true&spellcheck.count=1&spellcheck.collate=true&q=coffee AND countryId:1&defType=edismax&start=0&rows=10&fl=outletId,outletPhone1,outletPhone2,outletPhone3,outletUrl,outletGpsLatitude,outletGpsLongitude,outletAddress,outletPrimaryName,outletSecondaryName,brateCount,brateit_review,views,outletAvarageRating,outletRatingId,outletRatingValue,poBox,locatedInOutletId,locatedInOutletPrimaryName,locatedInOutletSecondaryName,locatedInName,floor,addressPlaceId,addressPlaceName_en,streetId,streetName_en,areaId,areaName_en,cityId,cityName_en,countryId,countryCode,countryName_en,plsId,plsName_en,categoryId,categoryName_en,ratingId,ratingName_en,primaryCategoryId,primaryCategoryName_en,primaryIndustryId,primaryIndustryName_en&facet=true&facet.limit=-1&facet.sort=count&facet.mincount=1&facet.field=facetCityName_en&facet.field=facetPoolCategory_en&facet.field=facetAreaName_en&sort=score desc, outletAvarageRating desc,brateCount desc,views desc,random_1347951132109 desc

第2页

spellcheck=true&spellcheck.onlyMorePopular=false&spellcheck.extendedResults=true&spellcheck.count=1&spellcheck.collate=true&q=coffee AND countryId:1&defType=edismax&start=10&rows=10&fl=outletId,outletPhone1,outletPhone2,outletPhone3,outletUrl,outletGpsLatitude,outletGpsLongitude,outletAddress,outletPrimaryName,outletSecondaryName,brateCount,brateit_review,views,outletAvarageRating,outletRatingId,outletRatingValue,poBox,locatedInOutletId,locatedInOutletPrimaryName,locatedInOutletSecondaryName,locatedInName,floor,addressPlaceId,addressPlaceName_en,streetId,streetName_en,areaId,areaName_en,cityId,cityName_en,countryId,countryCode,countryName_en,plsId,plsName_en,categoryId,categoryName_en,ratingId,ratingName_en,primaryCategoryId,primaryCategoryName_en,primaryIndustryId,primaryIndustryName_en&facet=true&facet.limit=-1&facet.sort=count&facet.mincount=1&facet.field=facetCityName_en&facet.field=facetPoolCategory_en&facet.field=facetAreaName_en&sort=score desc, outletAvarageRating desc,brateCount desc,views desc,random_1347951219828 desc

第 3 页

spellcheck=true&spellcheck.onlyMorePopular=false&spellcheck.extendedResults=true&spellcheck.count=1&spellcheck.collate=true&q=coffee AND countryId:1&defType=edismax&start=20&rows=10&fl=outletId,outletPhone1,outletPhone2,outletPhone3,outletUrl,outletGpsLatitude,outletGpsLongitude,outletAddress,outletPrimaryName,outletSecondaryName,brateCount,brateit_review,views,outletAvarageRating,outletRatingId,outletRatingValue,poBox,locatedInOutletId,locatedInOutletPrimaryName,locatedInOutletSecondaryName,locatedInName,floor,addressPlaceId,addressPlaceName_en,streetId,streetName_en,areaId,areaName_en,cityId,cityName_en,countryId,countryCode,countryName_en,plsId,plsName_en,categoryId,categoryName_en,ratingId,ratingName_en,primaryCategoryId,primaryCategoryName_en,primaryIndustryId,primaryIndustryName_en&facet=true&facet.limit=-1&facet.sort=count&facet.mincount=1&facet.field=facetCityName_en&facet.field=facetPoolCategory_en&facet.field=facetAreaName_en&sort=score desc, outletAvarageRating desc,brateCount desc,views desc,random_1347951286359 desc
4

1 回答 1

0

问题出在我的排序实现上。我按每页上的随机字段排序,导致文档在页面之间不断移动。

String randomField = random_"+ (new Date()).getTime();
于 2013-05-06T09:43:42.057 回答