xappy indexing is different to xapwrap indexing. By now we don't have found a way to access the xapian database by xapwrap from xappy. This likly means we won't be able to create the same kind of datastructure in the xappy xapian database.

xapwrap / xappy

   1 from MoinMoin.support.xapwrap import index as xapidx
   2 from MoinMoin.support.xapwrap import document as xapdoc
   3 
   4 import xappy

query = xapidx.RawQuery(xapdoc.makePairForWrite('itemid', itemid))

query = xapidx.RawQuery(xapdoc.makePairForWrite('itemid', att_itemid))

query = xapidx.RawQuery(xapidx.makePairForWrite(self.prefixMap['fulltitle'], pagename))

writer = xapidx.Index(self.dir, True)

connection = xappy.IndexerConnection(self.dir)

writer.configure(self.prefixMap, self.indexValueMap)

FieldActions description http://code.google.com/p/xappy/source/browse/trunk/xappy/fieldactions.py#379

connection.add_field_action('itemid', xappy.FieldActions.INDEX_EXACT) 

connection.add_field_action('wikiname', xappy.FieldActions.INDEX_EXACT) 

connection.add_field_action('wikiname', xappy.FieldActions.SORTABLE) 

# 'language' is the language to use when processing the field.

connection.add_field_action('title', xappy.FieldActions.INDEX_FREETEXT, 

                            weight=5, language=language) 

connection.add_field_action('title', xappy.FieldActions.SORTABLE) 

# 'spell' is a boolean flag - if true, the contents of the field will be used  

# for spelling correction. 

connection.add_field_action('content', xappy.FieldActions.INDEX_FREETEXT,  

                            language=language, spell=True) 

doc = xappy.UnprocessedDocument()

xapdoc.makePairForWrite('itemid', itemid)

doc.id =  itemid

doc.fields.append(xappy.Field('itemid', itemid))

xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or u"Self")

doc.fields.append(xappy.Field('wikiname', request.cfg.interwikiname or u"Self"))

xtitle = xapdoc.Keyword('title', title)

doc.fields.append(xappy.Field('title', title))

xcontent = xapdoc.TextField('content', file_content)

doc.fields.append(xappy.Field('content', file_content))

doc = xapdoc.Document(textFields=(xcontent, ), keywords=xmimetypes + [xtitle, xitemid, ], sortFields=(xpname, xattachment,xmtime, xwname, xrev, ), )

connection.replace(doc)

...

connection.flush()

http://xappy.org/docs/0.5/introduction.html

xappyan 1.0.7 missing features

MoinMoin: Xapian2009/API Changes (last edited 2009-07-27 10:38:26 by DmitriiMiliaev)