Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A Akonadi Search
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PIM
  • Akonadi Search
  • Merge requests
  • !5

Fix 370385: Search for contacts with underscore.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Sandro Knauß requested to merge work/hefee/search_underscore into master Feb 03, 2021
  • Overview 2
  • Commits 2
  • Pipelines 8
  • Changes 3

Currently we do word split by underscore. Th result is, that we cannot search for anything with a underscore. To fix this we need to add more words to the term list where also the term with underscore is added. I search in the history of baloo: This handmade term splitter was added to search for files with underscores (#336034).

So we need either get control over the term splitting, while searching, or add the term with underscore to terms list. When we want to provide both (splitted and non-splitted) we also need to take care about the position parameter.

Without patching xapiantermgenerator we can sill search for the complete email address on the commandline:

cd /tmp/searchplugintest/contacts
$ xapian-delve -t blue -d .
Posting List for term 'blue' (termfreq 1, collfreq 1, wdf_max 1): 101 []
$ xapian-delve -t jack_blue@test.com -d .
Posting List for term 'jack_blue@test.com' (termfreq 1, collfreq 1,
wdf_max 1): 101 []

but NOT:

$ xapian-delve -t jack_blue -d .
term 'jack_blue' not in database

The current solution makes the termgeneratortest fail, because we created more words, but fixes search for underscore value.

********* Start testing of TermGeneratorTest *********
Config: Using QtTest library 5.15.2, Qt 5.15.2
(x86_64-little_endian-lp64 shared (dynamic) release build; by GCC
9.3.0), neon 20.04
PASS   : TermGeneratorTest::initTestCase()
PASS   : TermGeneratorTest::testWordBoundaries()
FAIL!  : TermGeneratorTest::testUnderscore_splitting() Compared lists
have different sizes.
   Actual   (words) size: 3
   Expected (expectedWords) size: 2
   Loc:
[/home/neon/kdepim/src/kde/pim/akonadi-search/xapian/autotests/termgeneratortest.cpp(62)]
FAIL!  : TermGeneratorTest::testAccetCharacters() Compared lists have
different sizes.
   Actual   (words) size: 5
   Expected (expectedWords) size: 3
   Loc:
[/home/neon/kdepim/src/kde/pim/akonadi-search/xapian/autotests/termgeneratortest.cpp(78)]
FAIL!  : TermGeneratorTest::testUnicodeCompatibleComposition() Compared
values are not the same
   Actual   (words.size()): 2
   Expected (1)           : 1
   Loc:
[/home/neon/kdepim/src/kde/pim/akonadi-search/xapian/autotests/termgeneratortest.cpp(92)]
PASS   : TermGeneratorTest::testEmails()
PASS   : TermGeneratorTest::testWordPositions()
PASS   : TermGeneratorTest::cleanupTestCase()
Totals: 5 passed, 3 failed, 0 skipped, 0 blacklisted, 44ms
********* Finished testing of TermGeneratorTest *********

FIXES: 370385

FIXED-IN: 5.17.0

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: work/hefee/search_underscore