[prev in list] [next in list] [prev in thread] [next in thread]
List: amarok-devel
Subject: Re: Review Request: Match space-separated search terms individually
From: "Thomas Karpiniec" <tk () 1 ! 21jiggawatts ! net>
Date: 2010-11-02 3:51:30
Message-ID: 20101102035130.29260.31509 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100128/
-----------------------------------------------------------
(Updated 2010-11-02 03:51:29.998816)
Review request for Amarok.
Changes
-------
Added const modifier to QString
Summary
-------
With this patch a search string of space-separated words will return rows w=
hich match every word in the list. The old behaviour is to match rows conta=
ining the entire search string in any one of the fields searched.
This permits combination of terms Firefox-style: things like "beatles abbey=
" to find all tracks from Abbey Road, or "riv anda" to get "Andalucia" from=
Riverdance.
My only misgiving is that as implemented it will tokenise the search term o=
n every single attempted row match. As rowMatch() is called both directly i=
n several functions to find matches in SearchProxy.cpp and after a timeout =
to do the row filtering in SortFilterProxy.cpp, pulling the tokenisation up=
one level will require either that the tokenisation code is repeated, or t=
hat the search-related functions are all modified to use QStringLists inste=
ad of a QString. If that is a better way I'll do that, but as it stands row=
Match() is not a particularly small function so the small overhead seems re=
asonable.
Diffs (updated)
-----
src/playlist/proxymodels/ProxyBase.cpp b6ff53a =
Diff: http://git.reviewboard.kde.org/r/100128/diff
Testing
-------
Tested on a playlist of ~8000 tracks. Performance seems good, matching is a=
ccurate and it works just fine with single terms or inputs with extra space=
s.
Thanks,
Thomas
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/100128/">http://git.reviewboard.kde.org/r/100128/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Amarok.</div>
<div>By Thomas Karpiniec.</div>
<p style="color: grey;"><i>Updated 2010-11-02 03:51:29.998816</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Added const modifier to QString</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">With this patch a search string of space-separated words will return \
rows which match every word in the list. The old behaviour is to match rows \
containing the entire search string in any one of the fields searched.
This permits combination of terms Firefox-style: things like "beatles \
abbey" to find all tracks from Abbey Road, or "riv anda" to get \
"Andalucia" from Riverdance.
My only misgiving is that as implemented it will tokenise the search term on every \
single attempted row match. As rowMatch() is called both directly in several \
functions to find matches in SearchProxy.cpp and after a timeout to do the row \
filtering in SortFilterProxy.cpp, pulling the tokenisation up one level will require \
either that the tokenisation code is repeated, or that the search-related functions \
are all modified to use QStringLists instead of a QString. If that is a better way \
I'll do that, but as it stands rowMatch() is not a particularly small function so \
the small overhead seems reasonable.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Tested on a playlist of ~8000 tracks. Performance seems good, matching \
is accurate and it works just fine with single terms or inputs with extra \
spaces.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">
<li>src/playlist/proxymodels/ProxyBase.cpp <span style="color: \
grey">(b6ff53a)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/100128/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
Amarok-devel mailing list
Amarok-devel@kde.org
https://mail.kde.org/mailman/listinfo/amarok-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic