-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split fulltext search terms for both correctness and performance
Previously for searches like: Content LIKE "foo" AND Content LIKE "bar" If a ticket has "foo" saved in one attachment and "bar" in another, it wouldn't match because these fulltext criteria needed to match on a single attachment. What we want is to match on ticket level, i.e. as long as the ticket has "foo" and "bar" saved in some attachments of the given ticket, it should match. Thus we split the query into 2 and intersect them: (Content LIKE "foo") INTERSECT (Content LIKE "bar") For searches like: Content LIKE "foo" OR Subject LIKE "bar" We split the query and unite them accordingly: (Content LIKE "foo") UNION (Subject LIKE "bar") The latter version has much better performance as it makes use of fulltext indexes, unfortunately the former version can not right now. See also 8450f0a
- Loading branch information
Showing
5 changed files
with
293 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters