On 13 Lut, 12:18, Thomas Mueller <[email protected]> wrote:
> Hi,
>
> > In my database i have table t_person with columns first_name and
> > last_name. At this table i created full text lucene index
>
> From your description, I wonder if you really need a Lucene index, or
> if a regular index would be enough. Anyway, it is possible to do what
> you want, but it is not yet documented. I will document it:
>
> The Lucene fulltext search supports searching in specific column only.
> Column names must be uppercase (except if the original columns are
> double quoted), and column names that start with an underscore (_)
> need to be prefixed with another underscore. Example:
>
> CREATE ALIAS IF NOT EXISTS FTL_INIT FOR "org.h2.fulltext.FullTextLucene.init";
> CALL FTL_INIT();
> DROP TABLE IF EXISTS TEST;
> CREATE TABLE TEST(ID INT PRIMARY KEY, FIRST_NAME VARCHAR, LAST_NAME VARCHAR);
> CALL FTL_CREATE_INDEX('PUBLIC', 'TEST', NULL);
> INSERT INTO TEST VALUES(1, 'John', 'Wayne');
> INSERT INTO TEST VALUES(2, 'Elton', 'John');
> SELECT * FROM FTL_SEARCH_DATA('John', 0, 0);
> SELECT * FROM FTL_SEARCH_DATA('LAST_NAME:John', 0, 0);
> CALL FTL_DROP_ALL();
>
> Regards,
> Thomas

Hello,

It solution is exactly what i need. But it doesn't wort in my test
environment, i use h2 in version 1.2.120, is other version required?

Regards
sw

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to