Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Slow Contains queries with wildcards
Tue, Oct 5 2010 7:35 AMPermanent Link

Igor Colovic

In my application I have a option for searching words in documents. When users use wildcards to search for word parts the query is very slow. The problem is in BuildUnoptimizedContainsBitmap function witch is searching the whole index. I know this is a must when the search term is starting with *, but when the search term is starting with regular character (not a WILDCARD) it would be wise to use something like this:

procedure TEDBFilterIndexNavigator.BuildUnoptimizedContainsBitmap(
...
FKeyValues.Items[0].AsString := StringReplace(Value, '*', '', [rfReplaceAll]);
....
if (Search(FKeyValues, StringLength(FKeyValues.Items[0].AsString), ArgumentTokens[0].IgnoreCase, FoundChanges)=CMP_EQUAL) And (Not FoundChanges) then
                    while (not EOF) do
                       begin
                       if LikeString(IndexManager.ActiveIndex.IndexColumns[0].Collation,
....

I know this is not an optimal and correct source, because there is not checking if the word is starting with wildchard, but it is a suggestion. I hope this will go to the next build.

Best regards
Igor Colovic
Igor.Colovic@intermex.biz
http://www.propisi.com
Tue, Oct 5 2010 8:59 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Igor,

<< In my application I have a option for searching words in documents. When
users use wildcards to search for word parts the query is very slow. The
problem is in BuildUnoptimizedContainsBitmap function witch is searching the
whole index. I know this is a must when the search term is starting with *,
but when the search term is starting with regular character (not a WILDCARD)
it would be wise to use something like this: >>

We already do this with the LIKE, so yes, it can be done.  However, it will
only work with the ANSI or UNI collations, and won't work with other
collations.

I'll see what I can do about adding this in an upcoming build.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Oct 7 2010 6:41 AMPermanent Link

Igor Colovic

"Tim Young [Elevate Software]" wrote:

>>We already do this with the LIKE, so yes, it can be done.  However, it will
only work with the ANSI or UNI collations, and won't work with other
collations.

I am already using UNI collation (UNICODE version of EDB)

>>I'll see what I can do about adding this in an upcoming build.

Thank You.

Igor Colovic
Igor.Colovic@intermex.biz
www.propisi.com
Wed, Oct 20 2010 6:18 AMPermanent Link

Igor Colovic

"Tim Young [Elevate Software]" wrote:

>>We already do this with the LIKE, so yes, it can be done.  However, it will
only work with the ANSI or UNI collations, and won't work with other
collations.

Is there any news about adding this and when will next build be out.

Thank You.

Igor Colovic
Igor.Colovic@intermex.biz
www.propisi.com
Sun, Oct 24 2010 2:14 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Igor,

<< Is there any news about adding this and when will next build be out. >>

I'll try to get it into 2.04 B5, but no guarantees.  2.04 B5 should be out
sometime this week after the PHP extension is released.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image