knocean / knode

Knowledge Development Environment
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Text search #48

Closed inaimathi closed 7 years ago

inaimathi commented 7 years ago

Still incomplete; don't merge quite yet

jamesaoverton commented 7 years ago

Looking good!

jamesaoverton commented 7 years ago

Speed is good for ONTIE. I think we should search on keyup.

jamesaoverton commented 7 years ago

I played with this for an hour or so and I really like it.

inaimathi commented 7 years ago

Regarding indexing/re-indexing:

It takes quite a while, even on the ONTIE project, so I assume it would take enormous amounts of time on some of the larger ontologies you mention we'd want to support. This is why it currently doesn't happen on startup. I think it would be reasonable to add a command line flag that would force an index rebuild, but I'm not so sure that we want it happening by default (unless an index isn't already built). The assumption for changes is that we'd call add-term! each time something was changed, but a re-index would also be plausible (if more time consuming).

Regarding the exam/Example problem:

We can solve this either with some docs, or by subtly changing what search does. It seems reasonable that prefixes should be included in the search, so what we could do is have the back-end automatically add a trailing * to the search term (unless it already ends with * or whitespace).

I'll see what we can do about forward slashes. Presumably Lucene allows us to escape them in input, but I'll need to take a look before I can make a recommendation for certain.

The rest of those changes seem easy enough to do; I'll put together a commit.

jamesaoverton commented 7 years ago

Ok. Let's just create an index on startup if none exists, and merge what we've got now.

inaimathi commented 7 years ago

Managed to fix most of it before your comment above :P The only outstanding thing from that comment volley is the question of what to do about prefix matching (it would be easy enough to add in; I already had to add a saniatation step to support the forward slash behavior).