Search in Text fields

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Sep 1 00:46:01 CDT 2006


On 9/1/06 12:13 AM, "Pierre Rossel" <prossel2 at myrealbox.com> wrote:

Hi Pierre, 
 
> What is the best way to configure a field and to query in order to do full
> text search ?

At first you need mark this field as IndexedByWords
 
> To be able to find text with accentuated characters without having to enter
> them correctly, I process the user search string to replace characters such
> as e, é, è, ê... by [eéèê]. Is there a better way to do ?

You want do search that ignore accents?

Then take a look on

    db.CollationAttribute( kStrength ) = kSecondary
    ^^^^^^^^^^^^^^^^^^^^^


> I currently have a Text field and I am searching using REGEX (it seems that
> LIKE is now case sensitive).

You can control if search/sort/like/regex is case-sensitive  or not,
Using CollationAttribute.


------------
> There is one thing I cannot achieve. It is searching a phrase of several
words.
 
> If data contains "Hello world, the sun is shining", searching with "WHERE
> data REGEX '(?i)the sun'" wont return the record.
 
> I have tried with all possible combination of index and indexByWords, but
> none will work for searching a phrase. Could you provide a sample of a where
> clause ?

I think that no way do phrase search using this or that index. Because
IndexBywords do not have info about original phrase, only words. Simple
Index is limited to 256 bytes, so it will not work on the whole text value.

Only way do NON-indexed like. This is possible todo only via API way
currently. Vfield.FindLike() have second parameter to disable indexed
search.



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list