Problem/Motivation
search.module contains lots of procedural code that should be refactored.
Proposed resolution
Create a SearchText class / search.text service to use instead of the procedural code.
Remaining tasks
User interface changes
None
API changes
- search_invoke_preprocess() to \Drupal\search\SearchText::invokePreprocess()
- search_index_split() to \Drupal\search\SearchText::indexSplit()
- search_expand_cjk() to \Drupal\search\SearchText::expandCjk()
- search_simplify() to \Drupal\search\SearchText::simplify()
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2719961-6.patch | 24.32 KB | alexpott |
| #6 | 2-6-interdiff.txt | 3.86 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottI think we should also consider moving search_excerpt and _search_find_match_with_simplify() here too.
Comment #4
alexpottComment #6
alexpottComment #7
andypostSuppose new constants should be FQN interface
Comment #9
mile23These preg constants could be on Unicode instead, and then everyone could use them.
Not a blocker by any means, though.
Comment #10
jhodgdonI like the idea of this... The tests are not passing currently though. Not sure why, but the failures look to be real.
Some nitpicks/suggestions on the patch itself:
This whole section needs docs.
No docs here either
Missing {} around @inheritdoc
same here, missing {}
here too
and here.
This is not the correct documentation any more.
Comment #17
jhodgdon#3075703: Move search text processing to a service is a duplicate. Not sure which to close.
Comment #18
andypostI think better to close this one as duplicate because #3075703: Move search text processing to a service has green patch just missing constants conversion
Comment #20
kim.pepperClosing as duplicate of #3075703: Move search text processing to a service