[Xapian-discuss] I'm trying to relate what I know about Omega/Scriptindex with the actual data

James Aylett james-xapian at tartarus.org
Sun Jan 15 14:16:48 GMT 2012


On 15 Jan 2012, at 13:55, Jim Lynch wrote:

> Which is what I expect, however I have two "fields" unixdate and summary which I've specified as
> 
> unixdate : field date=unix
> summary : field
> 
> In my index file.  They are displayed in the delve output as
> 
> summary=Do you remember what was wrong with the bearings?
> unixdate=1181883741

That looks right. AIUI, without a keyword of `index` in scriptindex, no probabilistic terms will be generated. (The scriptindex documentation is a tiny bit confusing here, I think.)

> I don't see a set of terms that would correspond to either of these.  Yes, the words (terms) are there but no prefixes to indicate how they are related to the field names.  I assume there is some magic and/or delve isn't dumping everything.

I'm guessing that the terms are there because they're in other fields.

> The purpose of this investigation is to figure out how to add something to the document, storing this info.  In looking at the Document api, I only see how to add data, terms and values.  None of those three appear to be options either.


Xapian doesn't directly support what omega calls fields; it provides a blob of document data that you can use how you wish. Omega uses an encoding mechanism to turn this into a basic key-value store for fields, but you could also drop a JSON document in there, for instance. You need to decide what makes sense for your application.

If you want to read and write omega-style fields, that's not terribly difficult; the format is basically lines of key=value (I can't remember offhand whether there's a way of escaping newlines in the values).

J

-- 
 James Aylett
 talktorex.co.uk - xapian.org - devfort.com - spacelog.org




More information about the Xapian-discuss mailing list