Forums / General / Substring search

Substring search

Author Message

Gabriel Ambuehl

Tuesday 18 January 2005 11:53:32 am

Is there any way I can enable substring searches? This is a major deal in German which uses loads of concatenated nouns but also in other languages and with lazy users. This shouldn't be too hard (might be as simple as changing WHERE field='keyword' clauses to WHERE field like '%keyword%' to do...

Also, how about soundex searches / different spellings of the same word, but that's obviously a lot harder than substring searches ;-)

Visit http://triligon.org

Jo Havik

Wednesday 19 January 2005 5:15:36 am

There is no easy way to search for substrings (at least as I know :). The '%keyword%' approach does not work since the structure of the search engine cannot cope with the possibility of a SQL query returning more than one word (an exact match). Cannot remember the details, havent looked at this for some time.

We have, however, created a patched version of the search engine (for eZ publish v. 3.4) that indexes substrings of each word. This works, but your database will grow quite large..

Let me know if you want me to send this patch to you.

Jo H

--
Jo Havik / jo.havik at bodonihus.no

eZ debug

Timing: Jan 19 2025 00:33:34
Script start
Timing: Jan 19 2025 00:33:34
Module start 'content'
Timing: Jan 19 2025 00:33:34
Module end 'content'
Timing: Jan 19 2025 00:33:34
Script end

Main resources:

Total runtime0.0213 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0099 587.5781180.8516
Module start 'content' 0.00990.0057 768.429793.5938
Module end 'content' 0.01560.0056 862.023470.7031
Script end 0.0212  932.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.2741120.0002
Check MTime0.00125.6057120.0001
Mysql Total
Database connection0.00199.019310.0019
Mysqli_queries0.004320.339540.0011
Looping result0.00000.179520.0000
Template Total0.005224.410.0052
Template load0.00083.933110.0008
Template processing0.004320.401210.0043
Override
Cache load0.00062.611610.0006
General
dbfile0.00052.2223100.0000
String conversion0.00000.050530.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs