[MGNLEESOLR-47] Number of search results per page is inconsistent Created: 18/Feb/15  Updated: 27/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: Solr Search Provider
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2

Type: Bug Priority: Critical
Reporter: Edgar Vonk Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2015-02-18 at 09.13.00.png    
Issue Links:
relation
is related to MGNLEESOLR-25 Rework pagination in solr model classes Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLEESOLR-55 Add clean solr command into command c... Sub-task Closed Milan Divilek  
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Scenario:

  1. Perform a wildcard search. E.g. http://www.magnolia-cms.com/search.html?queryStr=* or http://www.magnolia-cms.com/search.html?queryStr=a*
  2. The pagination is incorrect. The first page only shows 1 result, the second no results at all, the last pages do show 20 results per page. See screenshot.

Maybe related to MGNLEESOLR-22?



 Comments   
Comment by Edgar Vonk [ 18/Feb/15 ]

Also (maybe this is another issue? not sure) some searches result in an incorrect number of results. E.g:
http://www.magnolia-cms.com/search.html?queryStr=info.nl

results in: "12 results found for the term "info.nl""

However only 4 are shown..

And also strange: searching on http://www.magnolia-cms.com/search.html?queryStr=magnolia
only shows 7 results on the first page, 20 on the second page and e.g. zero results on the 4th page:
http://www.magnolia-cms.com/search.html?queryStr=magnolia&currentPage=4

Comment by Edgar Vonk [ 13/Apr/15 ]

Good news. thanks!

Is it possible to give a little detail on the solution for this issue? Out of curiosity and to learn.

Comment by Jan Haderka [ 13/Apr/15 ]

FacetedSolrSearchProvider
How about replacing if (query != null && !query.isEmpty()) }} with {{StringUtils.isNotBlank(query)?

BTW you should really start writing tests. The code is getting more and more complicated with all the corner cases you are covering.

Comment by Milan Divilek [ 14/Apr/15 ]

Hi Edgar,

the issue was caused by outdated indexes (those which point to not existing pages) in Solr. Our corporate website uses "indexers" and in combination with old (before version 2.0) solr-search-provider module (MGNLEESOLR-18) this issue occurred very often.
In MGNLEESOLR-55 info.magnolia.search.solrsearchprovider.logic.commands.CleanSolrIndexCommand was added into filter chain with info.magnolia.module.indexer.crawler.CrawlerIndexerCommand to avoid outdated indexes if "crawlers" are used.

But issue can still occur in same cases. For example:
For "crawlers" - issue can occur in time frame between the times when crawler indexing is triggered.
For "indexers" - issue can occur for example when Solr server is down and change is done in indexed content.

So we've decided add check and remove outdated indexes in info.magnolia.search.solrsearchprovider.logic.providers.FacetedSolrSearchProvider#performFacettedSearch. This should cover all cases when solr contains outdated indexes. So user should receive results without removed pages.

Comment by Edgar Vonk [ 15/Apr/15 ]

Thanks Milan!

Generated at Mon Feb 12 10:59:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.