Your SlideShare is downloading. ×
0
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Interfaces to xapian
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Interfaces to xapian

917

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
917
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Interfaces to Xapian Open source search day 2009
  • 2. C++ #include <xapian.h> Xapian::WritableDatabase db(path, Xapian::DB_OPEN); Xapian::Document doc; doc.add_term(“foo”); db.add_document(doc);
  • 3. Python: xapian import xapian db = xapian.WritableDatabase(path, xapian.DB_OPEN) doc = xapian.Document() doc.add_term(“foo”) db.add_document(doc)
  • 4. Python: xappy from xappy import IndexerConnection, FieldActions db = xappy.IndexerConnection(path) db.add_field_action(“text”, FieldActions.INDEX_FREETEXT) doc = xappy.UnprocessedDocument() doc.append(“text”, “foo”) db.add(doc)
  • 5. Python: xappy from xappy import IndexerConnection, FieldActions db = xappy.IndexerConnection(path) db.add_field_action(“text”, FieldActions.INDEX_FREETEXT, language=”french”) doc = xappy.UnprocessedDocument() doc.append(“text”, “foo”) db.add(doc)
  • 6. from xappy2.core import * db = xappy.IndexerConnection(path) db.add_field_type(“text”, TEXT, language=”french”) db.add_index(“text”, StandardAnalyser) doc = xappy.UnprocessedDocument() doc.append(“text”, “foo”) db.add(doc) Python: xappy2.core
  • 7. Python: xappy2.server REST based API
  • 8. Python: xappy2.server PUT to /v1/dbs/dbname POST to /v1/dbs/dbname/schema/fields/text { 'type': 'text', 'freetext': {'language': 'en'} } } POST to /v1/dbs/dbname/docs { 'text': ['foo'] } (or PUT to /v1/dbs/dbname/docs/docid)
  • 9. Python: Zope: ore.xapian Zope style layer on top of xappy: class Content( object ): ... implements( interfaces.IIndexable ) Asynchronous loading/updating, event integration, etc
  • 10. Python: Django: Djapian Django integration layer on top of xapian import djapian class EntryIndexer(djapian.Indexer): fields=["text"] Tags=[ ("content", "content.text" ) ]
  • 11. Python: Django: Haystack Another Django integration layer on top of xapian from haystack import indexes class TextIndex(indexes.SearchIndex): text = indexes.CharField(document=True, use_template=True)
  • 12. Other Similar stack of interfaces for Ruby, PHP Java, C# just have bindings, so far
  • 13. Image Searching with Xappy db.add_field_action('image', FieldActions.IMGSEEK, terms = True) doc.fields.append('image', path_to_image_file) db.add(doc) query = sconn.query_image_similarity('image', docid='0')

×