[V4MD] Equivalent of V12's WordStarts operator?
Irv Kalb
Irv at furrypants.com
Mon Sep 29 13:39:49 CDT 2008
I appreciate the help, but I'm still not getting this to work the right way.
I believe you that that the problem is with the indexing, but I don't
know what I am doing wrong. I am trying to build my table using
INDEXBYWORDS. This table is designed so that each record is just a
single field which is a long string. The code I am using to create
the table is like this:
oTable = gDB.createTable(sTableName) -- creates a reference to my
table named 'sTable'
...
oField = oTable.createStringField("AuthorYearRefKeywords", 1024,
[#fIndexByWords]
curs = gDB.SqlSelect( "SELECT * FROM " & sTableName, #kClientSide, #kNoLocks )
if CheckValError() then exit
curs.ImportText(sFileName, TAB, RETURN, "UTF-8", TRUE)
if CheckValError() then exit
(I also tried createVarCharField, and createTextField with the same
results. I tried setting the flags to[#fIndex, #fIndexByWords] but
Valentina complained that this was an 'invalid type'.)
If I use Valentina Studio, I can see that this table was created and
in the fields column it says:
AuthorYearRefKeywords String[1536]:W
Does the W mean that it is set to be indexed by words?
When I go to access the table, I build a query string like this:
"SELECT AuthorYearRefKeywords FROM Biblio WHERE
(left(AuthorYearRefKeywords,4) = 'Hays')"
It DOES find records that start with 'Hays' but does NOT find ones
where those letters start a word (e.g, "James and Hays ... ").
I wanted to look at an example to see what I might be doing wrong, so
I searched through all the documentation, and I found this:
http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documentation:examples:guide:api_style:api_style#indexbywords_example
but none of the examples (including the one on IndexByWords example)
are clickable.
Thanks again,
Irv
At 10:00 AM +0300 9/27/08, Ruslan Zasukhin wrote:
>On 9/27/08 12:15 AM, "Irv Kalb" <Irv at furrypants.com> wrote:
>
>> I'm close, but it's not fully working.
>>
>> I have a sample table with only one long field called
>> AuthorYearRefKeywords. I create a table from this data, and I tried
>> marking the field as 'string', and also tried it as 'varchar' - I
>> marked the field with the flag: [#fIndexByWords].
>
>> If I look at the resulting table using Valentina Studio, and the one
>> field in this table has a maximum size, a colon, and the letter W
>> after it. I assume that this tell me that is it is indexed by words.
>
>Must be yet flag I -- fIndexed
>
>Right now you only have inform engine that you want IndexByWords,
>But have not create index itself yet
>
>
>> In my application, I am taking user input, which may be multiple
>> words, and building a query string to find matching records. If the
>> user types in: Hays, the query string I build is:
>>
>> "SELECT AuthorYearRefKeywords FROM Biblio WHERE
>> (left(AuthorYearRefKeywords,4) = 'Hays')"
>>
>> It successfully finds five records that start with the word 'Hayes', like
>> this:
>>
>> Hays, Kelley Ann, E. Charles Adams and Richard C. Lange, 1991,
>> Regional Prehistory ...
>>
>> However, it does NOT find any records where the word 'Hays' is
>> embedded in a record, like this:
>>
>> Adams, E. Charles and Kelley Ann Hays, (editors), 1991,\i
>> Homol'ovi II: Archaeology ...
>>
>>
>> I tried the "LIKE" syntax, but it did not get any matches all.
>>
>> I'm hoping that it's something simple.
>
>--
>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]
>
>
>_______________________________________________
>Valentina mailing list
>Valentina at lists.macserve.net
>http://lists.macserve.net/mailman/listinfo/valentina
--
Multimedia R Us
More information about the Valentina
mailing list