Offline full-text indexing

74 views
Skip to first unread message

Emiliano Heyns

unread,
Oct 18, 2013, 1:40:17 PM10/18/13
to zoter...@googlegroups.com
Hi,

I'm working on an extension that loads a pre-calculated index for my attachments. I can fetch this index, create .zotero-ft[info|cache], and load all the words into fulltextitems/fulltextitemwords/fulltextwords, and after loading, when I query my datbase with something like 

select i.*
from fulltextwords ftw
join fulltextitemwords ftiw on ftiw.wordID = ftw.wordID
join fulltextitems fti on fti.itemID = ftiw.itemID
join items i on i.itemID = fti.itemID
where ftw.word = 'friendship'

I get all the attachments listed whose body contains the word "friendship".

When I search in Zotero, however, I only get attachments back whose filename contains the word "friendship". How can I have Zotero pick up the fulltext words inserted into the database by my extension? Is another table consulted beyond the three listed above?

Thanks,
Emile

Dan Stillman

unread,
Oct 18, 2013, 2:31:52 PM10/18/13
to zoter...@googlegroups.com
No, though the cache files are consulted for phrase searches (after
checking the full-text word index to narrow down the scope, if I
recall). (Also note that this is all changing completely with 4.1.)

But as a general answer, if you're doing Zotero-related development, you
should run with debug output[1] enabled, which should help you figure
out exactly what Zotero is doing at any given time.


[1] http://www.zotero.org/support/debug_output#real-time_debug_output

Emiliano Heyns

unread,
Oct 18, 2013, 3:06:09 PM10/18/13
to zoter...@googlegroups.com
OK, that solved the problem -- I wasn't hitting the fulltext index because I was using the "simple" search, not the "advanced". In advanced, everything is found just fine.

I'm OK with 4.1 undoing this work, I need this right now, and there's no real ETA on 4.1 I think, and since the extension is drop-dead simple, I'll just redo it when 4.1 hits.

Is there any way for simple search to include attachment search?

Dan Stillman

unread,
Oct 18, 2013, 3:08:00 PM10/18/13
to zoter...@googlegroups.com
On 10/18/13, 3:06 PM, Emiliano Heyns wrote:
> Is there any way for simple search to include attachment search?

Choose "Everything" (instead of "Title, Creator, Year" or "All Fields &
Tags") from the drop-down.

Emiliano Heyns

unread,
Oct 18, 2013, 3:11:31 PM10/18/13
to zoter...@googlegroups.com
Fantastic. Apologies for the simplistic questions, but everything works splendidly now.




--
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/M1uMVOV7rdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+unsubscribe@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at http://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages