Re: Adding a column to the lucene fulltext index?

70 views
Skip to first unread message

Noel Grandin

unread,
Jan 2, 2013, 9:40:04 AM1/2/13
to h2-da...@googlegroups.com, Daniel Ziltener
See documentation:
http://h2database.com/html/tutorial.html#fulltext

On 2012-12-23 14:45, Daniel Ziltener wrote:
> I guess there's some way to add a table column to a lucene fulltext
> index? If so, how do I do that?
> And I noticed that there's nowhere a clear documentation of all the
> FTL_ functions, they're not even listed anywhere. Where can I find them?
> --
> You received this message because you are subscribed to the Google
> Groups "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/ftuSBXJflGgJ.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.

Daniel Ziltener

unread,
Jan 8, 2013, 2:27:47 AM1/8/13
to h2-da...@googlegroups.com, Daniel Ziltener
I think you misunderstood my intentions. What I'm trying to do is that I want to first create a table and the fulltext index for it - no problem. Then I want to alter the table by adding a column and want to add that column to the index, which does not seem to work?

Ryan How

unread,
Jan 8, 2013, 3:35:51 AM1/8/13
to h2-da...@googlegroups.com
My guess would be that you need to drop the index and recreate it?

http://h2database.com/javadoc/org/h2/fulltext/FullTextLucene.html

It doesn't look like it has a dropIndex() like the native fulltext search

What happens if you add Index for the table again and specify the new column?
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/co0K29FQJE8J.

Noel Grandin

unread,
Jan 9, 2013, 5:58:43 AM1/9/13
to h2-da...@googlegroups.com, Daniel Ziltener
Ah, that makes more sense.

I have implemented this and checked it into SVN.

You need to drop the index and then re-create it.

Be warned that it rebuilds all of the lucene full-text indices when you drop the index for a column.
(yeah, I know, not ideal, but I don't know the code that well, and I'm out of time for hacking on this)

Come to think of it, you might be better off just using FTL_DROP_ALL and then re-creating the necessary indices.
Reply all
Reply to author
Forward
0 new messages