Hi Bharat, Mindless, all,
finally I was able to complete the AND search capability for G2. Phew!
Please find the patch as text, compressed archive and zipped at:
http://georg-rehfeld.de/test/and_search_patch.txt http://georg-rehfeld.de/test/and_search_patch.tgz http://georg-rehfeld.de/test/and_search_patch.zipI ask for a review of the patch soon. I kept this change working since a
year, resolving all conflicts coming in in the meantime. This was due to
lack of time to finish the missing tests. You might imagine my pain not
beeing allowed to commit until the unit tests were finished, while the
feature itself worked well.
The unit tests are now in!
Please let me commit asap to get rid of these 'outgoing' changes!
+ What the AND search does
- it splits search input on white space except for quoted phrases, which
are preserved including white space
- all entered strings or quoted phrases must be present in the searched
field
- the search strings/phrases may be present anywhere in the field
- overlapping of strings is allowed and respected/highlighted in the
search result pages
+ Samples
Assume an entry like the following in some searchable field:
'The hottest girl in the german town Ascheffel shot a fox.'
If you wanna find items of a 'hot girl' (:-)) the existing G2 search
would not find this item. It only looks for the phrase 'hot girl', which
isn't present in the field.
The AND search finds that item. And it will highlight the found strings
correctly ('hot' in 2 places, 'girl' in 1 place).
Search for 'hot shot' and see the emphasis of the 'hot' inside the
'shot' in the search results.
Search for 'scheffel asche' and see the overlapping support in the word
'Ascheffel': the overlapping string 'sche' is again emphasized.
+ Implemetation hints
I replaced the javascript fix of bug 1422405 by a corresponding server
side solution with a new smarty modifier 'highlight'. The rest of my
changes are just straight forward.
Greetings, Georg/xlerb/deerwood
___ ___
| + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg
|_|_\ |___
rehfeld@... +49 (40) 23 53 27 10
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642__[ g a l l e r y - d e v e l ]_________________________
[ list info/archive -->
http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download -->
http://gallery.sf.net ]