Project

General

Profile

Actions

Bug #67843

closed

Epic #65814: Make Indexed search extbase plugin shine

Wrong queries in indexSearchRepository

Added by Tymoteusz Motylewski over 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
Start date:
2015-06-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Duplicate 'AND' in IndexSearchRepository.php

Line 562 and 627 both add a 'AND' string so the final query contains 'AND AND' and gets invalid.

The pi-based version of indexed search does not contain 'AND' in function execFinalQuery (SearchFormController.php line 1108)

There is something wrong with the implode function in statement
$wordSel = '(' . implode(' OR ', $this->wSelClauses) . ') AND ';
in line 614 in IndexSearchRepository.php
Implode returns double ORs ('OR OR'). Therefore the query gets invalid.

There are only search results for the first item in defaultFreeIndexUidList.
Other items return "no result" even if there are some.


Files

indexed_search_wSelClauses.patch (2.53 KB) indexed_search_wSelClauses.patch Manuel Link, 2015-06-30 22:46

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #38767: Incorrect order of search-resultClosed2012-07-09

Actions
Has duplicate TYPO3 Core - Bug #68667: Indexed Serach: Experimental plugin produces invalid SQL-queriesClosed2015-07-31

Actions
Actions #1

Updated by Tymoteusz Motylewski over 9 years ago

Issue originally reported by Gerhard Rupp

Actions #2

Updated by Tymoteusz Motylewski over 9 years ago

How can I reproduce the issue?
What TYPO3 version are you using?
I have checked the current 6.2 and 7 branch and it looks ok by reading.

Actions #3

Updated by Gerhard Rupp over 9 years ago

  • Target version set to 6.2.14

'AND' issue:
- Compare the "original" line in function execFinalQuery of th pi-based version of indexed search: There is no 'AND' in line 1108

'OR' issue:
- both lines of pi-based and extbased version are identical
- but if you do a var_dump of $wordSel you get double ORs

Actions #4

Updated by Gerhard Rupp over 9 years ago

I´m using TYPO3 6.2.13

Actions #5

Updated by Manuel Link over 9 years ago

After some more testing I can add some further information:

- due to testing several different versions we accidentally ended up with a slightly outdated version, the 'AND' issue has been resolved in the current 6.2 version

- the 'OR' issue is a result of using '$this->wSelClauses' in the sql-statement without filling it properly. Currently it only gets filled with empty strings (one for each search word).
- we tried going back to the old behaviour of filling it like in the pi-based version, works nice so far.

- when using this method for following items in the 'defaultFreeIndexUidList' the array '$this->wSelClauses' is filled repeatedly with the same values, so I think it should be cleared at the beginning of 'getPhashList'. This isn't really necessary, since the resulting query has the same result, but I think it might break the function in some configurations. (this should probably also be changed in the pi-based version)

attaching a patch file for the changes to 6.2

Actions #6

Updated by Alexander Opitz over 9 years ago

  • Target version changed from 6.2.14 to 6.2.15
Actions #7

Updated by Alexander Opitz over 9 years ago

@Manuel

Would you like to bring your patch into gerrit for master?

Actions #8

Updated by Tymoteusz Motylewski over 9 years ago

@Manuel, @Gerhard Can you guide me how can I reproduce the issue?
I mean, what plugin configuration should I have, what should I choose in the indexed search advanced search options?

I need that to verify whether the patch solves the issue.

Actions #9

Updated by Manuel Link over 9 years ago

Just reproduced it with a fresh 6.2.14 page with the introduction package.

All you need to do is include the standard "Indexed Search (experimental)" typoscript and start an advanced search with "Order by:" set to a value that starts with "rank_", e.g. "Weight/Frequency".

Now searching for one Word will result in "() AND " for "$wordSel", which is at the start of the select clause.
For two words it will be "( OR ) AND " and so on...

I hope this helps reproducing the issue.

Actions #10

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42219

Actions #11

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_7-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42220

Actions #12

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_7-3 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42221

Actions #13

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_7-3 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42221

Actions #14

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_7-3 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42221

Actions #15

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42219

Actions #16

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_7-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42220

Actions #17

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42222

Actions #18

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42222

Actions #19

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42219

Actions #20

Updated by Anonymous over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #21

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42670

Actions #22

Updated by Anonymous over 9 years ago

  • Status changed from Under Review to Resolved
Actions #23

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF